0

Ive got a wordpress site running on a VPS server and now need to migrate this to another VPS. So I've run an Export script from EMS MySql Manager(mymanager) that exported all the tables and data as a script.

Ive then gone over to my new server, with the same version of MySQL and MySql Manager installed, and tried to run the script.

However, the script keeps failing on the following block:

CREATE TABLE `wp_commentmeta` (
`meta_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`comment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`meta_key` VARCHAR(255) COLLATE utf8_general_ci DEFAULT NULL,
`meta_value` LONGTEXT COLLATE utf8_general_ci,
PRIMARY KEY USING BTREE (`meta_id`) COMMENT '',
INDEX `comment_id` USING BTREE (`comment_id`) COMMENT '',
INDEX `meta_key` USING BTREE (`meta_key`) COMMENT ''
)   
 ENGINE=InnoDB AUTO_INCREMENT=7 AVG_ROW_LENGTH=16384 CHARACTER SET utf8= COLLATE utf8_general_ci COMMENT=''
;

With (typically) this error:

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COMMENT '', INDEX comment_id USING BTREE (comment_id) COMMENT '', IN' at line 6

Any ideas as to how to resolve this and why the original DB is working fine and this script exports, yet it causes issue when trying to run the resultant script.???

4

1 回答 1

0

From what I can tell you can't put COMMENTs on keys, but this may vary based on the MySQL version. Anyway if the comments are just going to be empty anyway, you don't even need them. Just remove

COMMENT ''

from your ddl.

于 2013-06-20T20:07:09.523 回答