Some cases where MySQL cannot be started

Summary

When MySQL fails to start, common culprits include incorrect directory or file permissions within the $datadir, preventing normal read/write operations. Another frequent issue is a port conflict, where an existing MySQL instance or another service occupies the default port 3306. InnoDB configuration problems, particularly mismatches in log file sizes after parameter changes, can also prevent startup. Finally, a newly installed MySQL instance might fail to launch if the system library hasn't been initialized using `mysql_install_db`. Always begin troubleshooting by examining the MySQL error log for specific clues.

After installing MySQL, when we try to start MySQL, sometimes we may not be able to start it. The reasons can be different. We share some general cases where MySQL cannot be started.

Case 1: Directory or file permission issue

If the permission is set wrongly in MySQL's $datadir and its sub directories or files, MySQL will not be able to read and write files normally.

Error message:

mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe: line 107: /usr/local/mysql
/data/imysql.local.err: Permission denied

Case 2: Port conflict

There may be other mysqld instance is started and running. If it takes the same port, you need to change the port in order to start the new MySQL.

Error message:

[ERROR] Can't start server: Bind on TCP/IP port: Address already in use

[ERROR] Do you already have another mysqld server running on port: 3306 ?

[ERROR] Aborting

Case 3: innodb configuration issue

If datafile , log files setting is not correct in innodb, MySQL may not be started. Especially when you modify some parameters of innodb.

Error message:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes

InnoDB: than specified in the .cnf file 0 134217728 bytes!

[ERROR] Plugin ‘InnoDB’ init function returned error.

[ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

Case 4:  mysql system library not initialized

After installing MySQL, need to run mysql_install_db to initialize mysql system library.

Generally when facing the issue that MySQL cannot be started, the first thing to do is to check the error log. (You can find the error log at 4datadir/xx.err or var/log/message,/var/log/mysql/mysql.log). Then to solve find the cause of the error.

Source : http://imysql.cn/2013/08/08/mysql-faq-mysql-can-not-start.html

MYSQL ERROR LOG

  RELATED

  COMMENTS

0

No comment for this article.