mariadb 导入数据遇见得问题
2019-10-08 本文已影响0人
我的自动化测试历程
数据库启动
service mysqld start
mysql:1153 Got a packet bigger than ‘max_allowed_packet’ bytes的解决方法
1.临时修改:
mysql>setglobal max_allowed_packet=524288000; #修改 512M
2.修改my.cnf(windows下my.ini),需重启mysql。
在 [MySQLd] 部分添加一句(如果存在,调整其值就可以):
max_allowed_packet=256M (根据实际情况调整数值)
可通过命令:
showVARIABLESlike'%max_allowed_packet%’;
MySQL 建索引时 Specified key was too long; max key length is 767 bytes 错误的处理
SHOW variables like 'innodb_large_prefix'
临时修改
SET GLOBAL INNODB_LARGE_PREFIX = ON;
SHOW variables like 'innodb_file_format'
临时修改
SET GLOBAL innodb_file_format = BARRACUDA;
永久修改
vim /etc/my.con.d/server.conf
innodb_large_prefix=on
innodb_file_format=BARRACUDA