第一个:字符编码问题
错误:
Unknown collation: ‘utf8mb4_0900_ai_ci‘。。。。。。
解决方法:
手动修改sql文件:
utf8mb4_0900_ai_ci全部替换为utf8_general_ci
utf8mb4替换为utf8
第二个:TIMESTAMP 类型问题
错误:
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT
原因是当你给一个timestamp设置为on updatecurrent_timestamp的时候,其他的timestamp字段需要显式设定default值。但是如果你有两个timestamp字段,只把第一个设定为current_timestamp而第二个没有设定默认值,就会报错
解决方法:
给其他几个字段设置默认值:
DEFAULT '0000-00-00 00:00:00'
第三个:字符长度问题:
错误:
Specified key was too long; max key length is 767 bytes
解决方法:
在utf-8字符集下,255成功,utf-8一个字符占用3个字节,255*3=765 mysql5.6最长的索引是767。