Flite Careers

Re-installing Common_schema After Upgrading to MySQL 5.6

After upgrading from MySQL 5.5 to 5.6, I started getting some warnings when running queries in common_schema. For example:

1
2
3
4
5
6
7
8
9
10
+---------+------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                          |
+---------+------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1109 | Unknown table 'innodb_index_stats' in information_schema                                                                                         |
| Warning | 1109 | Unknown table 'innodb_index_stats' in information_schema                                                                                         |
| Warning | 1356 | View 'common_schema.processlist_repl' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| Warning | 1356 | View 'common_schema.processlist_top' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them  |
| Warning | 1356 | View 'common_schema.slave_hosts' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them      |
| Warning | 1356 | View 'common_schema.slave_status' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them     |
+---------+------+--------------------------------------------------------------------------------------------------------------------------------------------------+

The common_schema installer is good at accomodating whichever version of MySQL it is being installed on, but if you change that version it makes sense that common_schema needs to be re-installed. As stated in the documentation:

If you should upgrade your MySQL server, or enable features which were turned off during install of common_schema, the new feature set are not automatically available by common_schema, and a re-install of common_schema is required.

A re-install is easy. Here’s what I did:

1
2
wget https://common-schema.googlecode.com/files/common_schema-2.2.sql
mysql --init-command="set sql_log_bin = 0;" < common_schema-2.2.sql

Most of the warnings went away, but I’m still getting this:

1
2
3
4
5
6
+---------+------+----------------------------------------------------------+
| Level   | Code | Message                                                  |
+---------+------+----------------------------------------------------------+
| Warning | 1109 | Unknown table 'innodb_index_stats' in information_schema |
| Warning | 1109 | Unknown table 'innodb_index_stats' in information_schema |
+---------+------+----------------------------------------------------------+

Apparently in MySQL 5.6 the innodb_index_stats table has moved from information_schema to the mysql schema, so I submitted a bug report. So far this isn’t affecting the way I use common_schema, but if it did the common_schema source code is very readable so it would probably be a simple patch.


Comments