O servidor MySQL falha ao reiniciar após tentar importar o banco de dados da linha de comando

1

Meu servidor é o CentOS 6.5 64bit, executando o servidor da comunidade MySQL 5.5.42 da Remi. Eu tentei importar um banco de dados a partir da linha de comando, executando

mysql -u root -p website_database < website_database.sql

Após inserir a senha e o SQL foi iniciado, a seguinte mensagem é exibida:

ERROR 2013 (HY000) at line 288: Lost connection to MySQL server during query

Eu tentei reiniciar o servidor MySQL como root, mas a seguinte mensagem é exibida:

# service mysqld restart
Stopping mysqld:                                           [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

Então eu verifiquei o arquivo de log de erros do mysql, aqui está o conteúdo:

150214 20:51:41 mysqld_safe Number of processes running now: 0
150214 20:51:41 mysqld_safe mysqld restarted
150214 20:51:41 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
150214 20:51:41 [Note] Plugin 'FEDERATED' is disabled.
150214 20:51:41 InnoDB: The InnoDB memory heap is disabled
150214 20:51:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150214 20:51:41 InnoDB: Compressed tables use zlib 1.2.3
150214 20:51:41 InnoDB: Using Linux native AIO
150214 20:51:41 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
150214 20:51:41 InnoDB: Completed initialization of buffer pool
150214 20:51:41 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150214 20:51:41 [ERROR] Plugin 'InnoDB' init function returned error.
150214 20:51:41 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150214 20:51:41 [ERROR] Unknown/unsupported storage engine: InnoDB
150214 20:51:41 [ERROR] Aborting

150214 20:51:41 [Note] /usr/libexec/mysqld: Shutdown complete

150214 20:51:41 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

150214 20:53:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150214 20:53:29 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
150214 20:53:29 [Note] Plugin 'FEDERATED' is disabled.
150214 20:53:29 InnoDB: The InnoDB memory heap is disabled
150214 20:53:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150214 20:53:29 InnoDB: Compressed tables use zlib 1.2.3
150214 20:53:29 InnoDB: Using Linux native AIO
150214 20:53:29 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
150214 20:53:29 InnoDB: Completed initialization of buffer pool
150214 20:53:29 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150214 20:53:29 [ERROR] Plugin 'InnoDB' init function returned error.
150214 20:53:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150214 20:53:29 [ERROR] Unknown/unsupported storage engine: InnoDB
150214 20:53:29 [ERROR] Aborting

150214 20:53:29 [Note] /usr/libexec/mysqld: Shutdown complete

150214 20:53:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

A única maneira de reiniciar o servidor MySQL é reiniciando todo o servidor. Eu não tenho nenhuma pista, mesmo olhando para o arquivo de log, você sabe o que pode estar acontecendo? Obrigado.

    
por user702300 15.02.2015 / 03:07

1 resposta

1
InnoDB: mmap(137363456 bytes) failed; errno 12

Esse erro significa que o banco de dados não pode alocar memória , portanto você deve diminuir a innodb_buffer_pool_size value (eu realmente não o recomendo porque sua configuração atual já parece estar bastante baixa) ou atualize seu hardware para ter mais RAM.

    
por 15.02.2015 / 03:59

Tags