今天由于程序兼容问题,我必须要把5.7的版本切换成5.6 ,打开宝塔,备份数据库。安装mysql5.6 成功之后,发现导入数据的时候提示错误。
#1709 - Index column size too large. The maximum column size is 767 bytes.
于是我就开始百度了。问题解决了,来总结一下经验。希望可以帮助更多的人。
首先感谢这三个帖子:
https://www.cnblogs.com/chenpingzhao/p/5079325.html
https://www.jianshu.com/p/32611472e14c
https://blog.csdn.net/xianhenyuan/article/details/105375412
我们需要先进入mysql 设置一下:
先查询一下:
查看 innodb_file_format
相关变量SQL:
show variables like '%innodb_file_format%';
更改变量SQL:
set global innodb_file_format=Barracuda;
set global innodb_file_format_check=ON;
set global innodb_file_format_max=Barracuda;
具体操作代码如下:
mysql> show engines;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything