0

我正在尝试使用 pt-online-schema-change 来更改我的数据库中某些表的架构。程序因以下 MySQL 错误而崩溃。我不需要抛出这种错误。我已经尝试将 disable-partition-engine-check 放在 MySQL 服务器的启动上。我正在使用 MySQL 版本 5.7.21

错误:

 Level: Warning
Code: 1287
Message: The partition engine, used by table 'nokia_oss_stats_4g_timbrasil_dum._lte_cell_avail_new', is deprecated and will be removed in a future release. Please use native partitioning instead.
Query: INSERT LOW_PRIORITY IGNORE INTO `nokia_oss_stats_4g_timbrasil_dum`.`_lte_cell_avail_new` (`period_start_time`, `dateday`, `period_duration`, `dn_plmn`, `dn_mrbts`, `dn_lnbts`, `dn_lncel`, `dn_mcc`, `dn_mnc`, `m8020c0`, `m8020c1`, `m8020c10`, `m8020c11`, `m8020c12`, `m8020c2`, `m8020c3`, `m8020c4`, `m8020c5`, `m8020c6`, `m8020c7`, `m8020c8`, `m8020c9`, `netchart_count`) SELECT `period_start_time`, `dateday`, `period_duration`, `dn_plmn`, `dn_mrbts`, `dn_lnbts`, `dn_lncel`, `dn_mcc`, `dn_mnc`, `m8020c0`, `m8020c1`, `m8020c10`, `m8020c11`, `m8020c12`, `m8020c2`, `m8020c3`, `m8020c4`, `m8020c5`, `m8020c6`, `m8020c7`, `m8020c8`, `m8020c9`, `netchart_count` FROM `nokia_oss_stats_4g_timbrasil_dum`.`lte_cell_avail` FORCE INDEX(`PRIMARY`) WHERE ((`dateday` > ?) OR (`dateday` = ? AND `dn_plmn` > ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` > ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` > ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` > ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` = ? AND `dn_mcc` > ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` = ? AND `dn_mcc` = ? AND `dn_mnc` > ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` = ? AND `dn_mcc` = ? AND `dn_mnc` = ? AND `period_start_time` >= ?)) AND ((`dateday` < ?) OR (`dateday` = ? AND `dn_plmn` < ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` < ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` < ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` < ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` = ? AND `dn_mcc` < ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` = ? AND `dn_mcc` = ? AND `dn_mnc` < ?) OR (`dateday` = ? AND `dn_plmn` = ? AND `dn_mrbts` = ? AND `dn_lnbts` = ? AND `dn_lncel` = ? AND `dn_mcc` = ? AND `dn_mnc` = ? AND `period_start_time` <= ?)) LOCK IN SHARE MODE
4

2 回答 2

0

您可以在程序中忽略此警告而不停止它。如果这是第 3 部分程序,那么您应该更改 MySQL 中的设置并关闭 STRICT 模式并禁用不推荐使用的消息。

您可以编辑 my.cnf 文件并将 mysqld 部分添加到 sql_mode 的空值

[mysqld]
sql_mode=
于 2018-02-08T10:10:17.937 回答
0

您可以使用在终端上运行查询或 phpmyadmin 查询来启用严格模式-

mysql> set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

mysql> set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
于 2018-02-08T10:35:09.920 回答