模式从 mysql 4 迁移到 mysql 5.6 后的问题

Omr*_*mri 6 mysql mysqldump migration mysql-5.6

最近,我将一些模式从mysql 4实例迁移到了mysql 5.6bymysqldump和 import 操作的实例。经过一些语法调整,我可以成功导入转储文件。

导入后,我查看了日志文件,发现了一些问题。有谁知道那是什么以及如何解决它?

InnoDB: Error in pars0opt.cc: table cars/cars_ftr_a has prefix_len != 0
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_BEING_DELETED'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_BEING_DELETED_CACHE'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_CONFIG'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_DELETED'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_DELETED_CACHE'
InnoDB: in InnoDB data dictionary has unknown flags 50.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_000000000000040c_INDEX_1'
InnoDB: in InnoDB data dictionary has unknown flags 40.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_000000000000040c_INDEX_2'
InnoDB: in InnoDB data dictionary has unknown flags 40.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_000000000000040c_INDEX_3'
InnoDB: in InnoDB data dictionary has unknown flags 40.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_000000000000040c_INDEX_4'
InnoDB: in InnoDB data dictionary has unknown flags 40.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_000000000000040c_INDEX_5'
InnoDB: in InnoDB data dictionary has unknown flags 40.
2017-08-16 17:14:15 7fd3081c4700  InnoDB: Warning: table 'cars/FTS_00000000000002cb_000000000000040c_INDEX_6'
InnoDB: in InnoDB data dictionary has unknown flags 40.
Run Code Online (Sandbox Code Playgroud)

编辑(添加创建表语句)

Create Table: CREATE TABLE `cars_ftr_a` (
  `id` int(10) unsigned NOT NULL DEFAULT '0',
  `manufacturer` varchar(100) NOT NULL DEFAULT '',
  `model` varchar(255) NOT NULL DEFAULT '',
  `object_type` int(10) unsigned NOT NULL DEFAULT '0',
  `fts_string` text NOT NULL,
  `manufactor_id` int(10) unsigned NOT NULL DEFAULT '0',
  `model_id` int(10) unsigned NOT NULL DEFAULT '0',
  `version_id` int(10) unsigned NOT NULL DEFAULT '0',
  `version` varchar(100) NOT NULL DEFAULT '',
  `group_id` int(10) unsigned NOT NULL DEFAULT '0',
  `group_name` varchar(100) DEFAULT NULL,
  `a` int(10) unsigned DEFAULT NULL,
  `b` varchar(100) NOT NULL DEFAULT '',
  `price` int(10) unsigned NOT NULL DEFAULT '0',
  `c` int(10) unsigned NOT NULL DEFAULT '0',
  `d` varchar(100) NOT NULL DEFAULT '',
  `e` float NOT NULL DEFAULT '0',
  `f` int(10) unsigned NOT NULL DEFAULT '0',
  `g` int(10) unsigned NOT NULL DEFAULT '0',
  `h` int(10) unsigned NOT NULL DEFAULT '0',
  `i` smallint(6) unsigned NOT NULL DEFAULT '0',
  `j` varchar(100) NOT NULL DEFAULT '',
  `k` int(10) unsigned NOT NULL DEFAULT '0',
  `l` int(10) unsigned NOT NULL DEFAULT '0',
  `m` int(10) unsigned NOT NULL DEFAULT '0',
  `n` varchar(100) NOT NULL DEFAULT '',
  `o` int(10) unsigned NOT NULL DEFAULT '0',
  `p` text NOT NULL,
  `q` varchar(100) NOT NULL DEFAULT '',
  `r` int(10) unsigned NOT NULL DEFAULT '0',
  `s` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`,`fts_string`(10)),
  FULLTEXT KEY `fts_string` (`fts_string`)
) ENGINE=InnoDB DEFAULT CHARSET=hebrew
Run Code Online (Sandbox Code Playgroud)

Rol*_*DBA 2

发布表结构后,有两件事成为焦点

\n\n
    \n
  • InnoDB表有全文索引
  • \n
  • 您的字符集是希伯来语
  • \n
\n\n

您相信 7 年前有人问MySql 全文搜索是否可以合理地处理非拉丁语言(希伯来语、阿拉伯语、日语\xe2\x80\xa6)???

\n\n

您应该确保 MySQL 安装中具有希伯来语字符集

\n\n
mysql> select * from INFORMATION_SCHEMA.CHARACTER_SETS where CHARACTER_SET_NAME=\'Hebrew\';\n+--------------------+----------------------+-------------------+--------+\n| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION       | MAXLEN |\n+--------------------+----------------------+-------------------+--------+\n| hebrew             | hebrew_general_ci    | ISO 8859-8 Hebrew |      1 |\n+--------------------+----------------------+-------------------+--------+\n1 row in set (0.00 sec)\n
Run Code Online (Sandbox Code Playgroud)\n\n

以及必要的整理

\n\n
mysql> select * from INFORMATION_SCHEMA.COLLATIONS where CHARACTER_SET_NAME=\'Hebrew\';\n+-------------------+--------------------+----+------------+-------------+---------+\n| COLLATION_NAME    | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN |\n+-------------------+--------------------+----+------------+-------------+---------+\n| hebrew_general_ci | hebrew             | 16 | Yes        | Yes         |       1 |\n| hebrew_bin        | hebrew             | 71 |            | Yes         |       1 |\n+-------------------+--------------------+----+------------+-------------+---------+\n2 rows in set (0.00 sec)\n
Run Code Online (Sandbox Code Playgroud)\n\n

您可以尝试创建一个具有相同结构的新表并加载它。

\n\n

方法#1

\n\n
CREATE TABLE cars_ftr_a LIKE cars_ftr_a_new;\nINSERT INTO cars_ftr_a_new SELECT * FROM cars_ftr_a;\nRENAME TABLE cars_ftr_a TO cars_ftr_a_old,cars_ftr_a_new TO cars_ftr_a;\n
Run Code Online (Sandbox Code Playgroud)\n\n

方法#2

\n\n
ALTER TABLE cars_ftr_a ENGINE=InnoDB;\n
Run Code Online (Sandbox Code Playgroud)\n\n

然后,查看错误日志并查看是否再次出现相同的警告。如果他们不这样做,你就可以走了。您还应该考虑调整 InnoDB 全文选项。

\n\n

更新 2017-08-22 23:17 美国东部时间

\n\n

方法#3

\n\n

您可以尝试的另一件事是删除全文索引并重新创建它

\n\n
ALTER TABLE cars_ftr_a DROP INDEX `fts_string`;\nALTER TABLE cars_ftr_a ADD FULLTEXT `fts_string` (`fts_string`);\n
Run Code Online (Sandbox Code Playgroud)\n\n

然后,检查日志,看看是否再次出现相同的错误。

\n\n

更新 2017-08-23 11:04 美国东部时间

\n\n

方法#4

\n\n
CREATE TABLE cars_ftr_a LIKE cars_ftr_a_tmp;\nALTER TABLE cars_ftr_a_tmp DROP INDEX `fts_string`; \nINSERT INTO cars_ftr_a_tmp SELECT * FROM cars_ftr_a;\nRENAME TABLE cars_ftr_a TO cars_ftr_a_xxx,cars_ftr_a_tmp TO cars_ftr_a;\nALTER TABLE cars_ftr_a ADD FULLTEXT `fts_string` (`fts_string`);\n
Run Code Online (Sandbox Code Playgroud)\n\n

加载没有全文索引的新表。然后最后创建全文索引。

\n