Description:
MySQL 5.7.33 changed innodb_index_stats and innodb_table_stats system tables which requires mysql_upgrade to be run. This action is problematic for automated system package updates because it is not currently performed by the RPM postinstall scriptlets or via some other automated mechanism.
Currently, using a package system to perform automated updates for MySQL is incompatible with this because it requires some manual intervention to complete the upgrade process.
How to repeat:
1) Spin up a CentOS 7 or other supported system and install the MySQL Yum Repository using the following instructions -- this currently defaults to using the 8.0 repo, so disable that and enable the mysql57-community repo instead:
https://dev.mysql.com/downloads/repo/yum/
3) yum-config-manager --disable mysql80-community
4) yum-config-manager --enable mysql57-community
5) yum install mysql-community-server-5.7.22
6) systemctl start mysqld.service # Also verify that datadir was automatically initialized and service is running
7) yum upgrade # This should offer to upgrade to 5.7.23 or later, proceed to do so.
8) Check /var/log/mysqld.log and you should find warnings such as the following:
2018-08-15T16:46:56.272439Z 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2018-08-15T16:46:56.272498Z 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
Suggested fix:
To avoid issues with automated system maintenance any necessary update tasks should be performed during the package update process. Success of that particular method may be contingent on if mysql_upgrade can automatically authenticate with mysqld, which usually requires additional initial setup steps (such as use of ~/.my.cnf with password).
If it is not possible to automate this process, an alternative is to never make changes in minor MySQL version bumps that require manual intervention to apply.