Anonymous

What Is The Ibdata1 File In MySQL?

2 Answers

Rebecca Hunt Profile
Rebecca Hunt answered
The ibdata1 file is part of the InnoDB engine in MySQL. It is a very important file as part of the Microsoft program. If the file is deleted you will not be able to get MySQL to restart. If you do not work with the InnoDB engine you may be able to remove the file safely as long as you delete the ib_logfile* files too. MySQL uses these for reference for the ibdata 1 file. The program will not work if the ib_logfile* is still there since it is a reference. It feels there is something wrong with the software program and the references. This is why the best way to begin this process if you are not going to use InnoDB engine is to stop MySQL first. Move the ib* files out of the way to a temporary directory that has the disk space to handle it. Then start MySQL. You may need to check your databases to ensure they are still working once you have deleted the files.
The ibdata1 file is not going to shrink no matter what you try. You may also have trouble with purging the file once the disc space gets full. As long as you are using Innob Engine, you will need these files.
If you have any questions on what other files you can delete you may want to speak with a professional or find a reference book for MySQL that you can refer to. The program can be slightly complicated for layman users. If you have used it for a while chances are you are familiar with what programs start when you use certain aspects of the program, so you can feel comfortable with online answers.
Madbiker McMad Profile
Madbiker McMad answered
Spot on - ibdata1 is the data file for tables stored using the InnoDB engine. If you definitely aren't using this type of engine, you can safely delete it - but you must also delete the ib_logfile* files too. MySQL uses these to reference parts of the ibdata1 data file, and gets upset if these references don't work.

Safest thing is to stop mysql first, move these ib* files out of the way (to a temporary directory with sufficient disk space), then start mysql. All should be well then, but check your mysql databases for consistency.

Answer Question

Anonymous