报错信息:

2020-12-14  9:21:57 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1932: Table 'mysql.gtid_slave_pos' doesn't exist in engine
2020-12-14  9:21:57 0 [Note] Reading of all Master_info entries succeeded
2020-12-14  9:21:57 0 [Note] Added new Master_info '' to hash table
2020-12-14  9:21:57 0 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.3.20-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
2020-12-14  9:22:03 0 [Note] InnoDB: Buffer pool(s) load completed at 201214  9:22:03
2020-12-14  9:22:11 8 [Warning] IP address '192.168.130.202' could not be resolved: Name or service not known
2020-12-14  9:22:11 8 [ERROR] InnoDB: Table `mysql`.`innodb_table_stats` not found.

解决方法:

1.设置强制恢复:

echo "

innodb_force_recovery = 6
innodb_purge_threads = 1">>/etc/my.cnf

2.启动数据库systemctl start mariadb

3.使用mysqldump备份数据

     mysqldump -uroot -pPASSWORD DBNAME > /mnt/DBNAME.sql

4.备份/var/lib/mysql/下的ibdata1      ib_logfile0  ib_logfile1的nodb信息,并删除/var/lib/mysql/下的idb信息和库目录下的数据

5.sed  -i 's/innodb_force_recovery = 6/innodb_force_recovery = 0/g' /etc/my.cnf

6.重启数据库systemctl restart mariadb

7.使用4中备份数据恢复数据

mysqldump -uroot -pPASSWORD DBNAME < /mnt/DBNAME.sql

更多推荐