1

My server is CentOS 6.5 64bit, running MySQL 5.5.42 community server by Remi. I tried to import a database from command line by running

mysql -u root -p website_database < website_database.sql

After entering the password and SQL was initiated, the follow message is displayed:

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

I tried to restart the MySQL server as root, but the following message is displayed:

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

So I verified the mysql error log file, here is the content:

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

The only way to restart the MySQL server is by rebooting the whole server. I don't have any clue even looking into the log file, do you know what might be happening? Thank you.

1 Answer 1

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

This error means that the database cannot allocate memory, so you should either lower innodb_buffer_pool_size value (I don't really recommend it because your current setting seems to be quite low already) or upgrade your hardware to have more RAM.

4
  • The VPS server memory is only 512MB. Changed innodb_buffer_pool_size to 80M, it seems solved the issue. Thank you!
    – user702300
    Feb 15, 2015 at 5:16
  • Humm... the issue wasn't solved yet.
    – user702300
    Feb 15, 2015 at 5:30
  • 1
    Now set innodb_buffer_pool_size to 32M, hope it works.
    – user702300
    Feb 15, 2015 at 5:56
  • Looks like setting innodb_buffer_pool_size to 32M definitely solved the issue. Thank you!
    – user702300
    Feb 15, 2015 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .