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