升级到 mysql 8 后 MySQL 崩溃

升级到 mysql 8 后 MySQL 崩溃

我们将数据库升级到 MySQL 8 后,一个查询停止工作并导致数据库崩溃。MySQL 版本 8.0.19,之前:5.7

Error.log输出:

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f85d0240968): is an invalid pointer
Connection ID (thread ID): 11
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2020-04-05T09:59:12.862055Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 13111
2020-04-05T09:59:13.462707Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2020-04-05T09:59:13.475726Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2020-04-05T09:59:13.530885Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-05T09:59:13.564557Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.19'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
2020-04-05T09:59:13.704704Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
10:19:05 UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x564c309c2060
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 = 7fdb00628d50 thread_stack 0x46000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x564c2e75e78d]
/usr/sbin/mysqld(handle_fatal_signal+0x303) [0x564c2d7f8553]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7fdb348cc890]
/usr/sbin/mysqld(count_field_types(SELECT_LEX*, Temp_table_param*, List<Item>&, bool, bool)+0x5e) [0x564c2d716b6e]
/usr/sbin/mysqld(JOIN::optimize()+0x10f) [0x564c2d6c063f]
/usr/sbin/mysqld(SELECT_LEX::optimize(THD*)+0xeb) [0x564c2d71501b]
/usr/sbin/mysqld(SELECT_LEX_UNIT::optimize(THD*, TABLE*)+0x6b) [0x564c2d78278b]
/usr/sbin/mysqld(SELECT_LEX::optimize(THD*)+0x143) [0x564c2d715073]
/usr/sbin/mysqld(SELECT_LEX_UNIT::optimize(THD*, TABLE*)+0x6b) [0x564c2d78278b]
/usr/sbin/mysqld(Sql_cmd_dml::execute_inner(THD*)+0x38) [0x564c2d713b38]
/usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x458) [0x564c2d71d438]
/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0x2811) [0x564c2d6cd741]
/usr/sbin/mysqld(Prepared_statement::execute(String*, bool)+0x7d4) [0x564c2d6f9324]
/usr/sbin/mysqld(Prepared_statement::execute_loop(String*, bool)+0xb2) [0x564c2d6fbd32]
/usr/sbin/mysqld(mysqld_stmt_execute(THD*, Prepared_statement*, bool, unsigned long, PS_PARAM*)+0x189) [0x564c2d6fd449]
/usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0xdef) [0x564c2d6d0c1f]
/usr/sbin/mysqld(do_command(THD*)+0x1c4) [0x564c2d6d2964]
/usr/sbin/mysqld(+0xfbd800) [0x564c2d7e9800]
/usr/sbin/mysqld(+0x244b909) [0x564c2ec77909]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7fdb348c16db]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7fdb32ae788f]

这是一个持续的崩溃,并且只在我们的应用程序中执行某个特定操作后才会发生,但是,我们对 MySQL 和/或数据库不是很有经验。希望您能帮忙!

答案1

升级后您是否运行了 mysql_upgrade?对所有表运行“check table”以查看是否有任何损坏。您的服务器中是否有 ECC 内存?dmesg 或 syslog 中是否有任何硬件警告/错误(EDAC、MCE)?

很有可能你遇到了错误。根据我相当丰富的经验,最好避免在生产中使用 MySQL 5.6 之后的版本。MariaDB 的错误少得多。

相关内容