> For the complete documentation index, see [llms.txt](https://close.gitbook.io/yun-wei-bi-ji/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://close.gitbook.io/yun-wei-bi-ji/centos/mysql/mysql-cuo-wu-bao-cuo-jie-jue-fang-fa.md).

# Mysql 错误报错解决方法

> 错误信息: Got a packet bigger than 'max\_allowed\_packet' bytes

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

### 时间时差问题

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

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

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

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

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

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