VDS Sphera Knowledge Base
| Main / Browse Categories / MySQL / How can I repair corrupt MySQL tables? |
How can I repair corrupt MySQL tables?
|
Every so often, MySQL tables have a way of corrupting themselves. MySQL offers a quick and painless method of repairing those tables.
Login to your VDS via SSH and change directories to the database that is having problems. cd /usr/local/mysql/var/[DBNAME]/You will need to replace [DBNAME] with the actual name of your database. Stop the MySQL server: /etc/rc.d/init.d/mysql stopNOTE: Accounts created before July 7th, 2003 will want to use: /etc/rc.d/init.d/mysqld stopTo check the tables: myisamchk *.MYITo repair tables: myisamchk -r *.MYIRestart MySQL: /etc/rc.d/init.d/mysql startNOTE: Accounts created before July 7th, 2003 will want to use: /etc/rc.d/init.d/mysqld startAlternatively, if you do not want to shut down MySQL, you can use mysqlcheck. mysqlcheck [DBNAME]To repair the database tables: mysqlcheck -r [DBNAME]You will need to replace [DBNAME] with the actual name of your database.
You can find additional documentation here:
User Comments
|
||||||||
Attachments
| No attachments. |
Related Articles
|
|


