Падает mysql на CentOS сервере

497
24 июня 2017, 11:30

Добрый вечер! Столкнулся с проблемой: постоянно вылетает mysqld, и потом снова запускается с другим PID:

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  MyISAM: Initializing buffer pool, size = 8.0M
170621 20:14:38  MyISAM: Completed initialization of buffer pool
170621 20:14:38  MyISAM: 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  MyISAM: Assertion failure in thread 2968296304 in file btr/btr0cur.c line 201
MyISAM: Failing assertion: btr_page_get_prev(get_page, mtr) == buf_frame_get_page_no(page)
MyISAM: We intentionally generate a memory trap.
MyISAM: Submit a detailed bug report to http://bugs.mysql.com.
MyISAM: If you get repeated assertion failures or crashes, even
MyISAM: immediately after the mysqld startup, there may be
MyISAM: corruption in the MyISAM tablespace. Please refer to
MyISAM: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html
MyISAM: 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> 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>

ОС CentOS 6.4 Арх. i686

READ ALSO
INSERT в цикле WHILE

INSERT в цикле WHILE

Нужно в Mysql заполнить таблицу с оценкамиПытаюсь сделать это через while :

285
LOAD DATA LOCAL INFILE — не находит файл

LOAD DATA LOCAL INFILE — не находит файл

Интересует сразу несколько вопросов:

349