mysqlinnodb

What would happen if I delete the ibdata1 file in my mysql table and replace it with a new empty ibdata1 file?


I have a large database with hundreds of tables and over millions of records. I recently noticed that the ibdata1 file has a size of 360GB. It occupies a huge size in my server. I searched for several ways to reduce it and found it couldn't be shrunk.

Just for reference, what would happen if I just delete that ibdata1 file and create a empty new file in it's place...

Edit: In this question, the user deletes his file and unable to find older data after restarting the 'mysqld' service.

I'm planning to delete the old ibdata1 file and replace is with a empty ibdata1 file and want to know if it'll work.


Solution

  • ibdata1 contains the InnoDB dictionary, which is vitally important for InnoDB.

    If you delete it any access to a table will fail with this error:

    Table doesn't exist