發(fā)布時(shí)間:2020-08-07
欄目:其他
問題:MySQL無法正常啟動
查看日志
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
后來發(fā)現(xiàn)營造一處,升級后默認(rèn)啟用了caching_sha2_password身份認(rèn)證機(jī)制,以前的數(shù)據(jù)是不能直接運(yùn)行的知識和技能。
只能先恢復(fù)原版本取得顯著成效,將數(shù)據(jù)從原版本導(dǎo)出,重新導(dǎo)入使用實現,或再升級導(dǎo)入不容忽視。
一、卸載MySQL8.0.4
備份數(shù)據(jù)
mv /var/lib/{mysqlMySQL文章入庫助手,mysql.bak}
chown -R mysql:mysql /var/lib/mysql.bak
chmod 755 -R /var/lib/mysql.bak
直接yum卸載
rpm -qa|grep '^mysql'
然后將查詢出的8.0.4的包全部yum卸載
二服務體系、安裝MySQL8.0.3
從官方下載 8.0.3
下載打包版mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar
解壓
tar -xvf mysql-8.0.3-0.1.rc.el7.x86_64.rpm-bundle.tar
然后依次安裝common說服力、libs、client問題、server
rpm -ivh mysql-community-common-8.0.3-0.1.rc.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.3-0.1.rc.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.3-0.1.rc.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.3-0.1.rc.el7.x86_64.rpm
啟動mysql
systemctl start msyqld.service
此時(shí)/var/lib/重新生成了一個(gè)新的mysql文件夾
三逐漸顯現、數(shù)據(jù)導(dǎo)出
修改/etc/my.cnf指向舊數(shù)據(jù)
[mysqld]
innodb_force_recovery = 6
datadir=/var/lib/mysql.bak
Forcing InnoDB Recovery提供了6個(gè)等級的修復(fù)模式
innodb_force_recovery 參考: https://www.linuxidc.com/Linux/2018-02/151049.htm
全庫導(dǎo)出:
mysqldump -uroot -p --all-databases > /home/sqlfile.sql
四全會精神、數(shù)據(jù)恢復(fù)
修改/etc/my.cnf數(shù)據(jù)路徑發展機遇,去掉修復(fù)模式,修復(fù)模式下不可寫
[mysqld]
datadir=/var/lib/mysql
查看臨時(shí)密碼
[root@soft]# cat /var/log/mysqld.log|grep password
2018-02-23T08:06:36.785974Z 5 [Note] A temporary password is generated for root@localhost: Leyk2qO_75ER
用臨時(shí)密碼登錄mysqlmysql文章入庫軟件法治力量,修改密碼
放棄升級全技術方案,直接導(dǎo)入數(shù)據(jù)
mysql -uroot -p
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'abcdef@' WITH GRANT OPTION;
mysql>flush privileges;
mysql>source /home/sqlfile.sql;
重啟后,一切正常共享。升級前一定要備份,一定要經(jīng)常備份mysql文章入庫軟件信息化。
文章地址:http://61py.com/article/other/MySQLgfyczjyumsjdhwfqd.html