1

I've followed the instruction in this thread ( https://dba.stackexchange.com/questions/8982/what-is-the-best-way-to-reduce-the-size-of-ibdata-in-mysql ) successfully but after 2 months the ibdata1 continues to grow. I've tried optimizing tables but it didn't reclaimed lost storage space. How do i shrink ibdata1 file size? Is there any way to delete it safely?

Community
  • 1
  • 1
Christian Burgos
  • 1,572
  • 9
  • 26
  • 48
  • There are several uses for ibdata1 other than tables. How big is it now? If it is a few megabytes, I would not worry. Also, what is the value in my.cnf for its initial size? – Rick James Dec 01 '15 at 21:45

1 Answers1

3

As you want to reclaim the space from ibdata1 you actually have to delete the file:

  1. Do a mysqldump of all databases, procedures, triggers etc except the mysql and performance_schema databases
  2. Drop all databases except the above 2 databases
  3. Stop mysql
  4. Delete ibdata1 and ib_log files
  5. Start mysql
  6. Restore from dump

Source

Community
  • 1
  • 1
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331