Server environment: centos7.4.14
Problem: MySQL does not start properly
View Logs
2018-02-23T02:10:08.371209Z 0 [System] [MY-010116] /usr/sbin/mysqld (mysqld 8.0.4-rc-log) starting as process 27702 ...2018-02-23T02:10:08.737713Z 1 [ERROR] [MY-011096] No data dictionary version number found.2018-02-23T02:10:08.737989Z 0 [ERROR] [MY-010020] Data Dictionary initialization failed.2018-02-23T02:10:08.738038Z 0 [ERROR] [MY-010119] Aborting
It was later discovered that the Caching_sha2_password authentication mechanism was enabled by default after the upgrade, and the previous data was not run directly.
You can only restore the original version, export the data from the original version, re-import it, or upgrade the import.
First, uninstall 8.0.4
Backing up data
mv /var/lib/{mysql,mysql.bak}chown -R mysql:mysql /var/lib/mysql.bakchmod 755 -R /var/lib/mysql.bak
Direct Yum Offload
rpm -qa|grep ‘^mysql‘
Then will query out the 8.0.4 package all Yum Uninstall
Second, installation 8.0.3
Download 8.0.3 from official website
https://downloads.mysql.com/archives/community/
Download the packaged version of Mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar
Extract
tar -xvf mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar
Then install common, libs, client, server in turn
rpm -ivh mysql-community-common-8.0.3-0.1.rc.el7.x86_64.rpmrpm -ivh mysql-community-libs-8.0.3-0.1.rc.el7.x86_64.rpmrpm -ivh mysql-community-client-8.0.3-0.1.rc.el7.x86_64.rpmrpm -ivh mysql-community-server-8.0.3-0.1.rc.el7.x86_64.rpm
Start MySQL
systemctl start msyqld.service
At this point,/var/lib/a new MySQL folder is regenerated.
Third, data export
Modify /etc/my.cnf
point to old data
[mysqld]innodb_force_recovery = 6datadir=/var/lib/mysql.bak
Forcing InnoDB Recovery offers 6 levels of repair mode
Innodb_force_recovery Reference: http://blog.csdn.net/weitao_11/article/details/55050200
Full-Library Export:
Mysqldump-uroot-p--all-databases >/home/sqlfile.sql
Iv. Data Recovery
Modify the /etc/my.cnf
data path, remove the repair mode, repair mode is not writable
[mysqld]datadir=/var/lib/mysql
View temporary password
[[email protected]]# cat /var/log/mysqld.log|grep password2018-02-23T08:06:36.785974Z 5 [Note] A temporary password is generated for [email protected]: Leyk2qO_75ER
Log in to MySQL with a temporary password, change the password
Discard upgrade, import data directly
mysql -uroot -pmysql>GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ IDENTIFIED BY ‘[email protected]‘ WITH GRANT OPTION;mysql>flush privileges;mysql>source /home/sqlfile.sql;
After reboot, everything is OK. Be sure to back up before you upgrade, and always back up.
MySQL official source does not boot after upgrading from 8.0.3 direct yum to 8.0.4