mariadb 导入数据遇见得问题

数据库启动

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容