MySQL startup error solution case
After installing LAMP on a newly installed CentOS server, restart the system and find that MySQL cannot be started and the following error is reported:
/Etc/init. d/mysqld startStarting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/feixiag. pid ).
View the log as follows: InnoDB: Apply batch completed
17:28:05 24592 [Note] InnoDB: 128 rollback segment (s) are active.
17:28:05 24592 [Note] InnoDB: Waiting for purge to start
17:28:05 24592 [Note] InnoDB: 5.6.21 started; log sequence number 1600607
17:28:05 24592 [Note] Server hostname (bind-address): '*'; port: 3306
17:28:05 24592 [Note] IPv6 is available.
17:28:05 24592 [Note]-': 'resolves '::';
17:28:05 24592 [Note] Server socket created on IP :'::'.
17:28:05 24592 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql. user' doesn' t exist
150318 17:28:05 mysqld_safe mysqld from pid file/var/lib/mysql/feixiag. pid ended
After google and Baidu, I didn't find a good method. I suddenly remembered that when I initialized the database, I specified the datadir path as/data/mysql, and in/etc/my. the specified path is not modified for datadir in conf.
Check/etc/my. conf. It was not changed. It was started successfully after being changed to datadir =/data/mysql.
This article permanently updates the link address: