/var/lib/mysql/localhost.localdomain.pid【mysql服务启动出错】

centos 7安装mysql-5.6.36

mysql安装过程见:https://blog.csdn.net/qq_31073717/article/details/80635037

1.启动mysql提示出错

./mysql start
Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

2.从日志中找到两条错误

[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

 

在网上找到相关解决方法,直接输入

mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/

回车就好了,出现下面的信息:

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.


You can start the MySQL daemon with:

  cd /usr ; /usr//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr//my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

 

完美解决。

你可能感兴趣的:(hadoop)