博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
跨版本导入数据导致mysqld崩溃
阅读量:2511 次
发布时间:2019-05-11

本文共 1761 字,大约阅读时间需要 5 分钟。

现象

mysqld突然崩溃,错误日志
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fd06c41be28 thread_stack 0x40000
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(my_print_stacktrace+0x35)[0x8e37d5]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(handle_fatal_signal+0x41b)[0x651d0b]
/lib64/libpthread.so.0(+0xf500)[0x7fd1c9b2d500]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(_Z9get_fieldP11st_mem_rootP5Field+0x43)[0x769b43]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld[0x6768cc]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(_Z11mysql_grantP3THDPKcR4ListI11st_lex_userEmbb+0x4f1)[0x6785c1]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(_Z21mysql_execute_commandP3THD+0x4972)[0x6db4a2]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x531)[0x6dbb71]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1782)[0x6dd392]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x10d)[0x6a572d]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(handle_one_connection+0x42)[0x6a5862]
/opt/udb/program/mysql/mysql-5.6.20/bin/mysqld(pfs_spawn_thread+0x127)[0xaf8d87]
/lib64/libpthread.so.0(+0x7851)[0x7fd1c9b25851]
/lib64/libc.so.6(clone+0x6d)[0x7fd1c8b9590d]

原因分析

通过错误查看到(_Z11mysql_grantP3THDPKcR4ListI11st_lex_userEmbb+0x4f1),mysql_grant函数调用导致崩溃,猜测是用户授权时出了问题,重新登录db发现user表结构确实有问题,下图中1是崩溃后的表结构,2是该mysqld版本对应的user表结构

故障模拟

1 新建一个正常的db,表结构应该是上图中的2
2 删除user表,新建表结构1
3 执行grant语法创建一个新账户,这时mysqld就崩溃了

改进措施

1 任何跨版本导入数据,一定要执行mysql_upgrade
2 有些情况下mysql_upgrade还不一定够用,需要额外再去检查系统表有无问题,故障案例参见
http://blog.csdn.net/cug_jiang126com/article/details/51602757
你可能感兴趣的文章
经典SQL语句大全
查看>>
log日志记录是什么
查看>>
<rich:modelPanel>标签的使用
查看>>
<h:commandLink>和<h:inputLink>的区别
查看>>
<a4j:keeyAlive>的英文介绍
查看>>
关于list对象的转化问题
查看>>
VOPO对象介绍
查看>>
suse创建的虚拟机,修改ip地址
查看>>
linux的挂载的问题,重启后就挂载就没有了
查看>>
docker原始镜像启动容器并创建Apache服务器实现反向代理
查看>>
docker容器秒死的解决办法
查看>>
管理网&业务网的一些笔记
查看>>
openstack报错解决一
查看>>
openstack报错解决二
查看>>
linux source命令
查看>>
openstack报错解决三
查看>>
乙未年年终总结
查看>>
子网掩码
查看>>
第一天上班没精神
查看>>
启动eclipse报错:Failed to load the JNI shared library
查看>>