[ERROR] Native table ‘performance_schema’.’table name’ has the wrong structure

After I upgraded an instance to MySQL 5.7 I noted the following errors in the log;

2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_current' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_history' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_history_long' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_thread_by_event_name' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_digest' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'users' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure
2013-05-23 11:40:24 30199 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure

You can fix this with mysql_upgrade. Be aware of what the tool does before running this. Most importantly bear this in mind;

Because mysql_upgrade invokes mysqlcheck with the –all-databases option, it processes all tables in all databases, which might take a long time to complete. Each table is locked and therefore unavailable to other sessions while it is being processed. Check and repair operations can be time-consuming, particularly for large tables.

mysql_upgrade -h localhost -u root -p

After you have restarted the instance the errors will no longer be reported.


2 Comments

  1. Nico says:

    You’re my hero. I’ve been dealing with this issue and shooting in the dark until I found this simple command line. THANK YOU!!

  2. Rhys says:

    You’re welcome!

Leave a Reply