8

In mysqld.log I have thousands of lines like:

Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade

So, according to virtually every post on the matter (and error msg itself):

mysql_upgrade -u root -p

Enter password: 
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
...

and all tables in all databases are like

...
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.gtid_executed                                OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
The sys schema is already up to date (version 1.5.1).
Checking databases.
...

But, I am still getting the error in the log

2019-01-27T18:37:15.304587Z 66190 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-01-27T18:37:15.304620Z 66190 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-01-27T18:37:15.304684Z 66190 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-01-27T18:37:15.304707Z 66190 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade

The structure appears to be okay. Is there a config issue? Please advise.

The answer appears to be - reboot server. I do not have rights to do this, but after admin rebooted, issue appears to be resolved. Not sure why just rebooting MySQL did not fix?

migrated from serverfault.com Jan 27 at 22:43

This question came from our site for system and network administrators.

3

Do you have any clue what is going on when the Warning is being generated? It sounds like some form of version mismatch. Do you have any Plugins?

Please file a bug at bugs.mysql.com .

Meanwhile, do

USE mysql;
SHOW CREATE TABLE innodb_index_stats ;

Check, in particular, the definition of table_name. It used to be

`table_name` varchar(64) COLLATE utf8_bin NOT NULL,

8.0 changes it to

`table_name` varchar(199) COLLATE utf8_bin NOT NULL,

If it is still 64, simulate what mysql_update should have done, by doing

ALTER TABLE innodb_index_stats
    MODIFY   `table_name` varchar(199) COLLATE utf8_bin NOT NULL;

Ditto for innodb_table_stats.

  • There are no plugins. Just a plain vanilla MySQL instance. – Roy Hinkley Jan 28 at 16:36
  • Thanks. This answer popped up as the likely solution for the same problem we're having. The proposed solution is a lot less scary than running a blind command. – Steve Sether May 2 at 19:56
  • 2
    I tried the ALTER TABLE but the warning kept coming. I ran the mysq_upgrade and now no more warnings – bennythejudge Jun 19 at 20:20
3

Maybe this information is useful.

https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-23.html

Note

This release includes a change to the innodb_index_stats and innodb_table_stats system tables. When upgrading to this release, be sure to run mysql_upgrade in order to include these changes.


  • Straight to the point and great fix. Thank you! – develCuy Oct 23 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.