今天将数据库从5.6升级到5.7的过程中发现日志有如下关于分区表的warnings。
eprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
2017-12-21T03:08:49.944449Z 0 [Note] Beginning of list of non-natively partitioned tables
2017-12-21T03:08:49.947899Z 2 [Warning] The partition engine, used by table 'ddz_log.user_daily_data_change', is deprecated and will be removed in a future release. Please use native partitioning instead.
2017-12-21T03:08:49.947967Z 2 [Warning] The partition engine, used by table 'ddz_log.user_daily_log', is deprecated and will be removed in a future release. Please use native partitioning instead.
2017-12-21T03:08:49.951217Z 2 [Warning] The partition engine, used by table 'ddz_user_data.user_data', is deprecated and will be removed in a future release. Please use native partitioning instead.
2017-12-21T03:08:49.951299Z 2 [Warning] The partition engine, used by table 'ddz_user_data.user_extra_data', is deprecated and will be removed in a future release. Please use native partitioning instead.
2017-12-21T03:08:49.957746Z 0 [Note] End of list of non-natively partitioned tables
查看官方文档,有如下解决方案:
As of MySQL 5.7.9, mysql_upgrade looks for and attempts to upgrade partitioned InnoDB tables
that were created using the ha_partition handler. Also in MySQL 5.7.9 and later, you can upgrade
such tables by name in the mysql client using ALTER TABLE ... UPGRADE PARTITIONING.
只要对警告的分区表 做 ALTER TABLE ... UPGRADE PARTITIONING. 就可以了