As you may already know, many MySQL configuration parameters can be easily changed on-the-fly using SET GLOBAL var_name=var_value command. Of course, since MySQL will read and set up all variables from configuration file on each server restart, if we want to make change permanent, we need to update it's value in configuration file as well.
However, some variables may not be changed in such a trivial way. One of those variables is surely innodb_log_file_size. If you try to change it by simply changing it's value in configuration file followed by server restart, you will probably crash MySQL server and see error message like this
ERROR 1033 (HY000): Incorrect information in file...
Some variables cannot be changed using SET GLOBAL command but, again, can quite easily be changed by simply editing configuration file and making change there. After that, we simply perform MySQL server restart and that's it.
However, some variables may not be changed in such a trivial way. One of those variables is surely innodb_log_file_size. If you try to change it by simply changing it's value in configuration file followed by server restart, you will probably crash MySQL server and see error message like this
ERROR 1033 (HY000): Incorrect information in file...
For some reason, MySQL server will simply not start up if actual log files size does not match size defined in configuration file. Moreover, it may even crash and mess up completely.
So, if you really need to change size of log files, like I had to, make sure to follow these steps:
1 - Before doing anything, perform full MySQL server backup. Use any method you like but afterwards always test it to make sure you will be able to perform full restore, should one be needed.
2 - Shut down MySQL server.
3 - Move current log files (named ib_logfile0 and ib_logfile1) to some backup directory. MySQL server should not be able to find them during start-up process.
So, if you really need to change size of log files, like I had to, make sure to follow these steps:
1 - Before doing anything, perform full MySQL server backup. Use any method you like but afterwards always test it to make sure you will be able to perform full restore, should one be needed.
2 - Shut down MySQL server.
3 - Move current log files (named ib_logfile0 and ib_logfile1) to some backup directory. MySQL server should not be able to find them during start-up process.
4 - Change configuration file and update variable value according to your wishes.
5 - Start MySQL server.
Server should start normally and, since it will not find old log files, it will create new ones with correct size. You can even monitor this by watching log directory (directory in which log files are placed) during server start-up process.
5 - Start MySQL server.
Server should start normally and, since it will not find old log files, it will create new ones with correct size. You can even monitor this by watching log directory (directory in which log files are placed) during server start-up process.
No comments:
Post a Comment