Backup on version 5.6 server
/usr/local/mysql/bin/mysqldump-s/tmp/mysql3306.sock-a-P--set-gtid-purged=off > Backup_20160204.sql
Server operation in version 5.7
Mkdir-p/neworiental/data/mysql/mysql3307/{data,logs,relaylog,sock,tmp}
Chown-r Mysql:mysql/neworiental/data
Initializing the database
/usr/local/mysql/bin/mysqld--defaults-file=/neworiental/data/mysql/mysql3307/my3307.cnf--initialize-insecure
Recover database (full data)
/usr/local/mysql/bin/mysql-s/neworiental/data/mysql/mysql3307/sock/mysql3307.sock-p < Backup_20160204.sql
View all users without password!!!
Select User,host,authentication_string,plugin from Mysql.user;
Change Password
UPDATE mysql.user SET authentication_string=password (' PASSWORD ') WHERE user= ' root ' and host= ' localhost ';
FLUSH privileges;
Verify log in, logout, normal
After rebooting, it's still normal.
Only logs have an error.
2016-02-04t08:26:56.700344z 0 [ERROR] incorrect definition of table mysql.db:expected column ' User ' at position 2 to has Type char (+), found type char (16).
2016-02-04t08:26:56.700391z 0 [ERROR] mysql.user have no ' event_priv ' column at position 28
2016-02-04t08:26:56.700574z 0 [ERROR] Event Scheduler:an error occurred when initializing system tables. Disabling the Event Scheduler.
Perform a database upgrade
/usr/local/mysql/bin/mysqld_safe--DEFAULTS-FILE=/NEWORIENTAL/DATA/MYSQL/MYSQL3307/MY3307.CNF-- Skip-grant-tables &
/usr/local/mysql/bin/mysql_upgrade--defaults-file=/neworiental/data/mysql/mysql3307/my3307.cnf-p--force
After rebooting, the logs are fine.
Problem statement: (5.7.10)
GRANT all privileges on * * to ' root ' @ ' localhost ' identified by ' password ' with GRANT OPTION;
system table field is scrambled
Log records of Noboby can currently load!!!
Unable to login
Cannot stop
Here are the workarounds:
Workaround:
UPDATE mysql.user SET authentication_string=password (' PASSWORD ') WHERE user= ' root ' and host= ' localhost ';
UPDATE mysql.user SET plugin= ' mysql_native_password ' WHERE user= ' root ' and host= ' localhost ';
FLUSH privileges;
1. Verified that this statement is functioning correctly in version 5.6.28. (because it is a source library because it is a version because no migration has occurred)
2. No matter the overwrite, or the new, neither (version problem, later said)
There were two remaining 5.7 questions.
1. After the recovery of the database, mysql.user all users no password!!! (See CONCLUSION)
2. Using the full library restore, will be ' mysql.sys ' @ ' localhost ' coverage, do not know whether there is an impact? Must have an Impact! (See CONCLUSION)
Conclusions & Solutions verified
Because the database version problem, the whole library after the recovery, the system table will be overwritten, (in disguise to downgrade!!!) So Kua version of the case, the whole repository dump, after recovery, must do version update, and then restart the database!!!
Some minor problems with upgrading MySQL version 5.7 (RPM)