Table ‘performance_schema.session_variables’ doesn’t exist
- 发表于
- 设计开发
Mysql升级后出现错误:
1146 - Table 'performance_schema.session_variables' doesn't exist
其实不止这个错误,还有更多如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
Checking server version. Running queries to upgrade MySQL server. mysql_upgrade: [ERROR] 1146: Table 'mysql.innodb_table_stats' doesn't exist mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to EXECUTE mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE mysql_upgrade: [ERROR] 1146: Table 'mysql.innodb_index_stats' doesn't exist mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to EXECUTE mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_relay_log_info' doesn't exist mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to EXECUTE mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to EXECUTE mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_worker_info' doesn't exist mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to EXECUTE mysql_upgrade: [ERROR] 1243: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_worker_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_relay_log_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_relay_log_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_worker_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.slave_master_info' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.innodb_table_stats' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.innodb_index_stats' doesn't exist Checking system database. |
但只要是类似的自带主表结构错误,都可使用如下解决修复:
1 |
# mysql_upgrade -u root -p --force |
过程
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Repairing tables mysql.innodb_index_stats Error : Table 'mysql.innodb_index_stats' doesn't exist status : Operation failed mysql.innodb_table_stats Error : Table 'mysql.innodb_table_stats' doesn't exist status : Operation failed mysql.slave_master_info Error : Table 'mysql.slave_master_info' doesn't exist status : Operation failed mysql.slave_relay_log_info Error : Table 'mysql.slave_relay_log_info' doesn't exist status : Operation failed mysql.slave_worker_info Error : Table 'mysql.slave_worker_info' doesn't exist status : Operation failed Upgrade process completed successfully. Checking if update is needed. |
最后
1 |
# systemctl restart mysqld |
原文连接:Table ‘performance_schema.session_variables’ doesn’t exist
所有媒体,可在保留署名、
原文连接
的情况下转载,若非则不得使用我方内容。