Issue after moving the ib_logfile1 and ib_logfile0

2020-07-24 06:58发布

问题:

I wanted to increase the innodb_log_file_size for better performance. And i increased it from the default value to 256 MB. As usual i got the error saying InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes. So i moved these files to different location and restarted the mysql server. It worked. Before shuting down the mysql server i also made innodb_fast_shutdown = 0.

But i have a doubt, after mysql shutdown can we expect mysql is an consistent state and all the data that were in the ib_logfile0 and ib_logfile1 have been written to data files. So that i can delete these files or should i do something else also.

And if the answer is mysql will be in consistant state than why these files contain some data even after graceful shutdown and start up with innodb_fast_shutdown = 0.

Thanks in advance!!!!

回答1:

Steps I followed:

  1. SET GLOBAL innodb_fast_shutdown = 0
  2. /etc/init.d/mysqld stop
  3. rm -f /var/lib/mysql/ib_logfile0
  4. rm -f /var/lib/mysql/ib_logfile1
  5. /etc/init.d/mysqld start

these steps are correct and is accepted by RolandoMySQLDBA in this thread.