Home>Article>Operation and Maintenance> What to do if mysql fails to start under centos system
Problem:
Upgraded MySQL 5.1 to MySQL 5.6. After the upgrade, it failed to start MySQL.
Solution:
Open the MySQL log file and enter the command:
vim /var/log/mysqld.log
Find the error message in the log file. The error here is that the ibdata1 file size parameter has been modified, causing it to be different from the default value.
(Recommended tutorial:centos usage tutorial)
Solution:
Open the MySQL configuration file, Enter the command:
vim /etc/my.cnf
As stated in the error message: the value of ibdata1 is 640 pages and the value in the configuration file is 768 pages. So just modify the value of ibdata1 in innodb_data_file_path in my.cnf.
First calculate the initial value of ibdata1: 640/64 = 10M
The final configuration is:
innodb_data_file_path = ibdata1:10M:autoextend
If my.cnf does not have this configuration, just add it.
Related video tutorial recommendations:linux video tutorial
The above is the detailed content of What to do if mysql fails to start under centos system. For more information, please follow other related articles on the PHP Chinese website!