centos 7 5.5.56-MariaDB ERROR 2013(HY000):查询期间与MySQL服务器的连接丢失

时间:2018-04-05 09:51:58

标签: mysql mariadb centos7

突然CENTOS 7已经开始在我的*"2013 (HY000): Lost connection to MySQL server during query"*上遇到问题。我收到了错误 当我尝试通过子查询更新表时update table1 set sal=32 where prikey in (select id from table2 where....),例如:mysqlcheck。这些表是myisam而不是innodb。

我查看[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 ,一切报告都很好。我也看到了关于缓存的线程,但没有好处。这在生产系统中非常可怕......

您的回复表示赞赏。

非常感谢你。此致

堆栈跟踪

if ($conn->query($sql) === TRUE) {

    // If the record inserted successfully then show the message.
    $MSG = "New record created successfully";

// Converting the message into JSON format.

    $json = json_encode($MSG);

// Echo the message.
    echo $json;

} else {
    $errorMsg="Error: " . $sql . "<br>" . $conn->error;
    $json = json_encode($errorMsg);
    echo $json;
}

1 个答案:

答案 0 :(得分:0)

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

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