mysql - centos 7 5.5.56-MariaDB 错误 2013 (HY000) : Lost connection to MySQL server during query

标签 mysql mariadb centos7

突然间,我的 CENTOS 7 上的 MariaDB 开始出现问题。我收到错误 *"2013 (HY000): 在查询期间失去与 MySQL 服务器的连接"* 当我尝试通过子查询更新表时,例如: update table1 set sal=32 where prikey in (select id来自表2,其中......)。这些表是 myisam 而不是 innodb。

我用mysqlcheck检查过,一切都报告正常。我还看到了有关缓存的线程,但效果不佳。这在生产系统中发生是非常可怕的......

感谢您的回复。

非常感谢。问候

堆栈跟踪

[ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

Server version: 5.5.56-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 466711 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x5645e589bab0
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 = 0x7f053c0a3dc0 thread_stack 0x48000
/usr/libexec/mysqld(my_print_stacktrace+0x3d)[0x5645e290096d]
/usr/libexec/mysqld(handle_fatal_signal+0x515)[0x5645e2516285]
/lib64/libpthread.so.0(+0xf5e0)[0x7f0542d235e0]
/usr/libexec/mysqld(+0x396724)[0x5645e240a724]
/usr/libexec/mysqld(_Z20get_best_combinationP4JOIN+0x35b)[0x5645e2410dcb]
/usr/libexec/mysqld(+0x3b73b3)[0x5645e242b3b3]
/usr/libexec/mysqld(_ZN4JOIN8optimizeEv+0x675)[0x5645e242e625]
/usr/libexec/mysqld(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0xc8)[0x5645e23ddb18]
/usr/libexec/mysqld(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_ordery15enum_duplicatesbPySB_+0x3f9)[0x5645e246f359]
/usr/libexec/mysqld(_Z21mysql_execute_commandP3THD+0x2de5)[0x5645e23e8815]
/usr/libexec/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x125)[0x5645e23ec8c5]
/usr/libexec/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1753)[0x5645e23ee923]
/usr/libexec/mysqld(_Z24do_handle_one_connectionP3THD+0x1c2)[0x5645e24a0632]
/usr/libexec/mysqld(handle_one_connection+0x4a)[0x5645e24a06da]
/lib64/libpthread.so.0(+0x7e25)[0x7f0542d1be25]
/lib64/libc.so.6(clone+0x6d)[0x7f054151934d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f0510004c18): update...
Connection ID (thread ID): 1
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off

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.
180405 12:46:16 mysqld_safe Number of processes running now: 0
180405 12:46:16 mysqld_safe mysqld restarted
180405 12:46:16 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 5586 ...
180405 12:46:16 InnoDB: The InnoDB memory heap is disabled
180405 12:46:16 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180405 12:46:16 InnoDB: Compressed tables use zlib 1.2.7
180405 12:46:16 InnoDB: Using Linux native AIO
180405 12:46:16 InnoDB: Initializing buffer pool, size = 128.0M
180405 12:46:16 InnoDB: Completed initialization of buffer pool
180405 12:46:16 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
180405 12:46:16  InnoDB: Waiting for the background threads to start
180405 12:46:17 Percona XtraDB (http://www.percona.com) 5.5.52-MariaDB-38.3 started; log sequence number 4191004
180405 12:46:17 [Note] Plugin 'FEEDBACK' is disabled.
180405 12:46:17 [Note] Server socket created on IP: '0.0.0.0'.
180405 12:46:17 [Note] Event Scheduler: Loaded 0 events
180405 12:46:17 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.56-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Serve

最佳答案

尝试将查询重新表述为多表UPDATE,而不是使用IN ( SELECT ... )。后者效率较低。

(你应该考虑切换到 InnoDB。)

关于mysql - centos 7 5.5.56-MariaDB 错误 2013 (HY000) : Lost connection to MySQL server during query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49669319/

相关文章:

mysql - MariaDB 备份工具 Mariabackup 失败并出现错误

ssh - 连接到 CentOS 7.9 时出现 SSH 错误 Permission Denied

mysql 外键约束在禁用时失败

mysql - 如何将 "between yyyy-mm-dd and yyyy-mm-dd"插入准备好的语句中?

mysql - 如何使用 VB.net 创建自定义 CrytalReporting 模板并将文件保存为 PDF

mysql - 错误 1452 : Cannot add or update a child row: a foreign key constraint fails

ansible - scl enable rh-mariadb102 bash 不适用于 Ansible playbook

linux - laravel centOS 7 chmod 755/775 权限被拒绝“无法打开 : failed to open stream: Permission denied", 仅允许我设置为 777

mysql - 在 CentOS7 上使用 Debian 基础运行 MySQL docker 镜像

php - MySQL 查询 - 如何以某种方式对结果进行排序