By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Incorrect Information in File == MySQL Table Corrupted?

P: 1
Hi Experts,

I encountered the following problem when I'm trying to open SOME tables in MySQL database:
"Incorrect information in file ./[database name]/[table name].frm"

Other tables within the same database can be opened without any issues, only some tables have this problem. And this is not just happening in one database, but the other database on the same server also has this problem (there are 2 databases AFAIK on this server). Not sure if anyone else is using this server. The database is InnoDB, running on Win2k3. Are there any other information that is required that I didn't provide?

I have read through posts in mysql forum and it seems like none of them is able to solve my problem. The database used to work since being deployed 2 years ago and the last time the my.ini is amended is 2 years ago.

It sounded like a data corruption issue to me and the only way is to perform data restoration from the last known working state. However, is there something wrong somewhere that I can check and fix without needing to do a restoration of the database? The users are dead against it as it would mean loss of data since the date of restoration.

Thanks!
May 5 '15 #1

✓ answered by elliottkerr

1. Edit my.cnf (usually located in /etc/my.cnf) and add this line into [mysqld] section
innodb_force_recovery=4
2. Restart mysql (e.g: /etc/init.d/mysqld restart)
3. Your MySQL log should tell you which table is corrupt. You can dump the table using “SELECT … INTO OUTFILE …” from mysql console or using tool like mysqldump
o Example using MySQL query (you also need to dump the schema later)
mysql> SELECT * FROM corrupted_table INTO OUTFILE ‘/path/to/file’
o Example using mysqldump
root# mysqldump –opt -u uname -p dbname corrupted_tablename > /path/to/out.sql
4. Go back to my.cnf and comment the line you wrote from step #1
5. Go intoMySQL console and drop the corrupted table
mysql> DROP TABLE corrupted_tablename;
6. Import data dump, for sql dump you can use:
root# mysql -u uname -p < /path/to/out.sql
7. Go back into mysql console, check and optimize all tables
8. Done
9. As last variant visit http://www.filerepairforum.com/forum...came-corrupted

Share this Question
Share on Google+
1 Reply


P: 1
1. Edit my.cnf (usually located in /etc/my.cnf) and add this line into [mysqld] section
innodb_force_recovery=4
2. Restart mysql (e.g: /etc/init.d/mysqld restart)
3. Your MySQL log should tell you which table is corrupt. You can dump the table using “SELECT … INTO OUTFILE …” from mysql console or using tool like mysqldump
o Example using MySQL query (you also need to dump the schema later)
mysql> SELECT * FROM corrupted_table INTO OUTFILE ‘/path/to/file’
o Example using mysqldump
root# mysqldump –opt -u uname -p dbname corrupted_tablename > /path/to/out.sql
4. Go back to my.cnf and comment the line you wrote from step #1
5. Go intoMySQL console and drop the corrupted table
mysql> DROP TABLE corrupted_tablename;
6. Import data dump, for sql dump you can use:
root# mysql -u uname -p < /path/to/out.sql
7. Go back into mysql console, check and optimize all tables
8. Done
9. As last variant visit http://www.filerepairforum.com/forum...came-corrupted
May 8 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.