MySQL 服务器已消失,mysqld 已死,但子系统已锁定

MySQL 服务器已消失,mysqld 已死,但子系统已锁定

我在 i686 PC 上运行 Centos 6.4,mysqld 出现问题。它总是重新启动,请看示例。抱歉,我的英语不好。

service mysqld status
mysqld (pid  21563) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  21616) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  21667) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  21718) is running...
[root@ip mysql]# service mysqld status
mysqld dead but subsys locked
[root@ip mysql]# service mysqld status
mysqld dead but subsys locked
[root@ip mysql]# service mysqld status
mysqld (pid  21820) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  21922) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  21973) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  22026) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  22026) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  22128) is running...
[root@ip mysql]# service mysqld status
mysqld (pid  22179) is running...

这是 /etc/my.cnf:

[mysqld]
bind-address = 127.0.0.1
general_log = 1
general_log_file = /var/log/mysql/mysql.log
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
wait_timeout = 28800
max_allowed_packet = 32M
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
wait_timeout = 28800
max_allowed_packet = 32M
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

查看/var/log/mysqld.log:

Thread pointer: 0x0
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 = 0 thread_stack 0x30000
/usr/libexec/mysqld(my_print_stacktrace+0x2e) [0x84c6d3e]
/usr/libexec/mysqld(handle_fatal_signal+0x484) [0x82ec8b4]
[0xac3400]
[0xac3424]
/lib/libc.so.6(gsignal+0x51) [0x70f861]
/lib/libc.so.6(abort+0x17a) [0x71113a]
/usr/libexec/mysqld() [0x8396186]
/usr/libexec/mysqld(btr_cur_search_to_nth_level+0xabe) [0x839715e]
/usr/libexec/mysqld(row_search_index_entry+0x79) [0x8417949]
/usr/libexec/mysqld() [0x8416517]
/usr/libexec/mysqld(row_purge_step+0x5ab) [0x841779b]
/usr/libexec/mysqld(que_run_threads+0x535) [0x8404a45]
/usr/libexec/mysqld(trx_purge+0x375) [0x8432605]
/usr/libexec/mysqld(srv_master_thread+0x75b) [0x842a67b]
/lib/libpthread.so.0(+0x6b39) [0x6d0b39]
/lib/libc.so.6(clone+0x5e) [0x7c7ace]
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.
170621 20:14:38 mysqld_safe Number of processes running now: 0
170621 20:14:38 mysqld_safe mysqld restarted
170621 20:14:38  InnoDB: Initializing buffer pool, size = 8.0M
170621 20:14:38  InnoDB: Completed initialization of buffer pool
170621 20:14:38  InnoDB: Started; log sequence number 0 1965184248
170621 20:14:38 [Note] Event Scheduler: Loaded 0 events
170621 20:14:38 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170621 20:14:39  InnoDB: Assertion failure in thread 2968296304 in file btr/btr0cur.c line 201
InnoDB: Failing assertion: btr_page_get_prev(get_page, mtr) == buf_frame_get_page_no(page)
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
17:14:39 UTC - mysqld got signal 6 ;
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.
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.

key_buffer_size=8384512
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337742 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

有时我可以从 mysql CLI 连接并运行查询:

mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: *** NONE ***

+--------------------+
| Database           |
+--------------------+
| information_schema |
| asterisk           |
| asteriskcdrdb      |
| drupal             |
| drupal2            |
| drupal3            |
| drupal4test        |
| mysql              |
| statistics         |
| test               |
+--------------------+
10 rows in set (0.00 sec)

mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
ERROR:
Can't connect to the server

mysql>

可用空间:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       458G   51G  385G  12% /
tmpfs           2.5G     0  2.5G   0% /dev/shm
/dev/sda1       291M   32M  245M  12% /boot

我也重启了服务器并重启了 mysqld 很多次,但都没有用。有什么想法吗?任何信息对我来说都非常有用 )

答案1

您的 my.cnf 中的 [mysqld] 部分似乎缺少一些典型条目。此时建议的 CAP 添加 thread_cache_size = 100 # 可能有助于您入门。

mysqlcalculator.com 将在您目前的体验中为您提供价值。

相关内容