Server:centos 7.0
mysql:5.7.20 MySQL Community Server (GPL)
1. Change Password after first login:
According to the choice of installation, there are mysqld_safe with Mysqld_safe, no use mysqld. The normal installation should be in the/usr/sbin directory
A) Start MySQL
Mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
b) No password entry MSYQL
Mysql-u Root MySQL
c) Change Password
UPDATE user SET password=Password (' NewPassword ') where user=' root ';
Will find this error: "Error 1054 (42S22): Unknown column ' Password ' in ' Field list '
In the latest version of MySQL, the command should read:
UPDATE user SET authentication_string=PASSWORD (' NewPassword ') where user=' root ';
D) Refresh exit
Flush privileges;
Exit
2. Each login prompt needs to change the password:
Log in after exiting and discover whatever you do will prompt
ERROR 1820 (HY000): Must reset your password using ALTER USER statement before executing this statement.
Then, you can only set it again
UPDATE user SET Password=password (' NewPassword ')
But after exiting and entering again, there will still be this hint. Very pit ...
Workaround:
UPDATE user SET Authentication_string=password (' NewPassword ') where user= ' root ' and host= ' root ' or host= ' localhost ';
It seems that all the empty passwords are set to a valid password, MySQL 5.6 does not have this limitation. 5.7, we have it now.
Flush privileges; After you exit, you won't be prompted to change your password.
3. Unable to start error
Check Mysqld.log and find the following error record
====================================
Innodb:unable to lock./ibdata1, Error:11
Innodb:check that already has another mysqld process
===================================
Root cause: Startup file, occupied by another process. In fact, most of the time, when the mysqld is restarted, the previous resources are not fully released.
Solution:
1) PS aux |grep mysq* #找到锁住资源的进程
2) Kill-s 9 process number # Kill process
3) Restart Mysqld
MySQL 5.7 Installation completed after the first landing several issues