Mysql 错误报错解决方法

错误信息: Got a packet bigger than 'max_allowed_packet' bytes

# 调整  max_allowed_packet  数据包
[mysqld]
max_allowed_packet=100M

时间时差问题

[mysqld]
default-time_zone = '+8:00'

解决外键约束无法删除问题

Cannot delete or update a parent row: a foreign key constraint fails

# 关闭外键约束检查
SET foreign_key_checks = 0;

drop table xxx;
delete from xxx where id=x;

# 开启外键约束检查
SET foreign_key_checks = 1;

Last updated