MySQL生成 core dump文件

前提条件

添加配置

[mysqld]下面添加core-file

image-20211016232603862

ulimit打开core file限制

1
ulimit -c unlimited

如需要,修改core file路径(如在容器内,需要特权容器权限)

1
echo "/opt/sh/mysql/core/core" > /proc/sys/kernel/core_pattern

使得core file携带pid信息

1
echo 1 >/proc/sys/kernel/core_uses_pid

通过kill命令获取core file

1
kill -11 $pid

image-20211016233105059