#解除安全限制 0 ,开启安全限制 1
show variables like ‘SQL_SAFE_UPDATES‘;
SET SQL_SAFE_UPDATES = 1;
#查看语句执行情况
show processlist;
mysql在执行脚本时,报出了以下错误:
index column size too large. the maximum column size is 767 bytes
解决方案:
1. 对数据库进行设置
set global innodb_file_format = BARRACUDA
set global innodb_large_prefix = ON
set global innodb_file_per_table = on
注意: 在navicat中执行成功,不清楚重启数据库是否还有效
查看是否生效
show variables like ‘character%‘;
show variables like ‘collation_%‘;
show variables like ‘innodb_large_prefix‘;
show variables like ‘innodb_file_format‘;
2. 对脚本进行修改,添加ROW_FORMAT=DYNAMIC
create table test (........) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;