473,408 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Incorrect Information in File == MySQL Table Corrupted?

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

1 2727
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

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

Similar topics

4
by: steve | last post by:
I have an on-going problem that my ".MYI" mysql files get corrupted. I have written php trapping routine to report on the problem to admin. My next step is to initiate "repair table" right after...
0
by: Google Mike | last post by:
This has been discussed before back in 2002, and then in Feb of 2003 when I did a search on Google Groups for MySQL Table Sizes. Back then, people said go here: ...
0
by: Jean-Luc Fontaine | last post by:
Here is what I did: - I had a perfectly working compressed table: ccc in database ddd - uncompressed it: # myisamchk -u history200310 - recovering (with sort) MyISAM-table 'ccc' Data records:...
10
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without...
3
by: JAYO | last post by:
The MySQL table is located in a Linux Server OS, so I need the information from that table for updating Paradox tables in Windows OS. If a PHP program in the Linux Server can save a file with the...
2
by: holdingbe | last post by:
Hi, I haven’t select data from any table in mysql database. While I selected the data I got ERROR 1033 (HY000): Incorrect information in file error. I have not changed any...
3
by: Marjeta | last post by:
I have installed MySQL 5.0.67 yesterday. Previously we were using 4.0. On the development server, testing server, and training server this upgrade went smooth. The only thing I did there was run...
0
by: anil2083 | last post by:
Hello, I am getting this exception when i am trying to login JDBCExceptionReporter:Incorrect key file for table '/tmp/#sql_6caf_0.MYI'; try to repair it . I am unable to understand how to...
3
by: xaverkahl | last post by:
Hello Experts, I had a issue with a MYSQL Table. Here's my scenario. CentOS Linux 6.4 MySQL version 5.1.69 When trying to run a script to update some tables the Mysql shows a warning at the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.