>show create table sys_area;
'CREATE TABLE `sys_area` (
`id` varchar(50) NOT NULL,
`name` varchar(255) NOT NULL,
`parentId` int(11) DEFAULT NULL,
`code` varchar(1000) DEFAULT NULL COMMENT ''用来快速查询'',
`priority` int(11) DEFAULT NULL,
`fee` float(10,2) DEFAULT ''0.00'',
`valid` int(11) DEFAULT ''1'',
`weight` int(11) DEFAULT ''10'' COMMENT ''排序的权值'',
`level` int(11) DEFAULT NULL,
`available` int(11) DEFAULT ''0'' COMMENT ''0: 不可用, 1: 可用'',
`status` tinyint(4) DEFAULT ''0'',
`createUser` varchar(50) DEFAULT NULL,
`createDate` timestamp NULL DEFAULT NULL,
`updateUser` varchar(50) DEFAULT NULL,
`updateDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_code` (`code`(180)) USING BTREE,
KEY `idx_level` (`level`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT'
>update sys_area set code = code + ',' where code not regexp'%,';
Response:
Error Code: 1062. Duplicate entry '0' for key 'idx_code'
正确语句:
>update sys_area set code = concat(code, ',') where code not regexp'%,';
2、使用mysql workbench 6.2.5.0导出5.6.16-log到5.6.23失败
10:06:31 Restoring game_dev (admin_config)
Running: mysql.exe --defaults-file="c:\users\liang\appdata\local\temp\tmpkjgddd.cnf" --protocol=tcp --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments < "F:\\database\\dumps\\Dump20150518\\game_dev_admin_config.sql"
ERROR 1839 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_MODE = ON.
Operation failed with exitcode 1
解决方案: