问题
150814 9:09:14 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
150814 9:09:14 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
150814 9:09:14 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.44-cll-lve' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) by Atomicorp
Then I run
mysql_upgrade
It shows:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed
回答1:
It seems this happens after you have done upgrade. Simply restart mysql:
service mysql restart
and the error should now have disappeared.
回答2:
If you're running MySQL on your local device, you need to upgrade your mysql and then restart:
Upgrade:
$ mysql_upgrade -u root
Restart:
$ mysql.server restart
回答3:
Windows7 Pro, Mysql 5.7, Java Tomcat
I attempted to update the mysql server from version 5.7.8 to version 5.7.18 using the Windows web updater available on Mysql.com. The new version installed, started as a service, but wouldn't serve anything including log in.
Using the Windows command box, change directory to C:\Program Files\MySQL\MySQL Server 5.7\bin
Type: mysql_upgrade --force -u root -p
Enter the password of the previous version that is being upgraded.
Restart the Mysql service at Windows > Start > Administrative Tools > Services
The Mysql server immediately started and connected to the Java Servlet container.
回答4:
Same problem here
$ mysqldump -h localhost --lock-all-tables --set-gtid-purged=OFF -u root -p --socket=/var/run/mysqld/mysqld.sock --all-databases > dump.sql
mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'ndbinfo\_version'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)
Have you test a
$ mysql_upgrade -u root -p
or
$ mysql_upgrade --force -u root -p
回答5:
mysqldump just add parameter like this: --skip-lock-tables
can avoid this error:
mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'ndbinfo\_version'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)
来源:https://stackoverflow.com/questions/32000911/errornative-table-performance-schema-has-the-wrong-structure