1

suddenly our mysql, shutdowns more and more.

I get this error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

And I have to restart the mysqld service.

Can someone please help me with this?

We got 18000 products 3000 categories, and probably 5000 visitors daily.

my.cnf =

max_allowed_packet = 15000M
innodb_buffer_pool_size = 6G
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 100M
server-id=2
max_connections = 1024

Btw here is my last mysql error log:

151120 10:39:35 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

151120 10:39:55 mysqld_safe Starting mysqld daemon with databases from /data/mysql/datafiles

151120 10:39:55 [Warning] option 'max_allowed_packet': unsigned value

15728640000 adjusted to 1073741824

151120 10:39:55 [Note] Plugin 'FEDERATED' is disabled.

151120 10:39:55 InnoDB: The InnoDB memory heap is disabled

151120 10:39:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins

151120 10:39:55 InnoDB: Compressed tables use zlib 1.2.3

151120 10:39:55 InnoDB: Using Linux native AIO

151120 10:39:55 InnoDB: Initializing buffer pool, size = 6.0G

InnoDB: mmap(6593445888 bytes) failed; errno 12

151120 10:39:55 InnoDB: Completed initialization of buffer pool

151120 10:39:55 InnoDB: Fatal error: cannot allocate memory for the buffer pool

151120 10:39:55 [ERROR] Plugin 'InnoDB' init function returned error.

151120 10:39:55 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

151120 10:39:55 [ERROR] Unknown/unsupported storage engine: InnoDB

151120 10:39:55 [ERROR] Aborting

3
  • 1
    Check your disk space Commented Nov 20, 2015 at 20:24
  • MySQL DBA issue, look at your MySQL system logs to find out why MySQL itself is completely disappearing. You might want to contact your hosting provider. Commented Nov 20, 2015 at 21:57
  • This question would be better asked here: dba.stackexchange.com Commented Nov 21, 2015 at 10:54

1 Answer 1

1
max_connections = 1024
innodb_log_buffer_size = 100M
innodb_buffer_pool_size = 6G

change it to

max_connections = 80
innodb_log_buffer_size = 16M
innodb_buffer_pool_size = 2G

to properly set innodb_buffer_pool_size you need to run this script: https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl

InnoDB buffer pool / data size: ??G/??G

if your data size is greater than available memory, then you will have to cleanup your database. if nothing to cleanup, then you need more RAM.

there are probably more issues with your setup, but in this case when mysql crashed it can not restart back:


InnoDB: Fatal

error: cannot allocate memory for the buffer pool 151120 10:39:55
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.