Home  >  Q&A  >  body text

mysql-configuration - MySQL error, automatically hangs from time to time and cannot be started

mysql hangs up from time to time and cannot be started. What is the reason?

my.cnf configuration:

[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip -external-locking
log-error=/alidata/log/mysql/error.log
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
skip-name-resolve

log-bin=mysql-bin
binlog_format=mixed
server-id = 1

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
expire_logs_days = 5
max_binlog_size = 1000M

Error log log:
170421 14:16:49 mysqld_safe Number of processes running now: 0
170421 14:16:49 mysqld_safe mysqld restarted
2017-04-21 14:16:49 1480 [Note] Plugin 'FEDERATED' is disabled.
2017-04-21 14:16:49 1480 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-04-21 14:16:49 1480 [Note] InnoDB: The InnoDB memory heap is disabled
2017-04-21 14:16:49 1480 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-04-21 14:16: 49 1480 [Note] InnoDB: Memory barrier is not used
2017-04-21 14:16:49 1480 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-04-21 14:16: 49 1480 [Note] InnoDB: Using Linux native AIO
2017-04-21 14:16:49 1480 [Note] InnoDB: Using CPU crc32 instructions
2017-04-21 14:16:49 1480 [Note ] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2017-04-21 14:16:49 1480 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-04-21 14:16:49 1480 [ERROR] Plugin 'InnoDB' init function returned error.
2017-04-21 14:16:49 1480 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-04-21 14:16:49 1480 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-04-21 14:16:49 1480 [ERROR] Aborting

2017-04-21 14:16:49 1480 [Note] Binlog end
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'partition'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'BLACKHOLE'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_METRICS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_CMP'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'INNODB_TRX'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'ARCHIVE'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'MyISAM'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'CSV'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'MRG_MYISAM'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'MEMORY'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'sha256_password'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'mysql_old_password'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'mysql_native_password'
2017-04-21 14:16:49 1480 [Note] Shutting down plugin 'binlog'
2017-04-21 14:16:49 1480 [Note] /alidata/server/mysql/bin/mysqld: Shutdown complete

170421 14:16:49 mysqld_safe mysqld from pid file /alidata/server/mysql/data/iZ23czua4kgZ.pid ended

仅有的幸福仅有的幸福2735 days ago717

reply all(6)I'll reply

  • 迷茫

    迷茫2017-05-18 10:57:52

    The memory is not enough. I haven’t seen how much mysql memory you configured. It usually takes up 75% of the OS

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-18 10:57:52

    InnoDB: Cannot allocate memory for the buffer pool

    Look at this sentence, there is not enough memory. If you use Baidu yourself, be sure to find the wrong information

    reply
    0
  • 某草草

    某草草2017-05-18 10:57:52

    If the memory parameter innodb_buffer_pool_size is not set, 128M will be used by default in 5.6 and above, which is not enough memory. It is recommended to use a lower version 5.5 or increase the memory

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-18 10:57:52

    Memory problem, not enough

    reply
    0
  • 高洛峰

    高洛峰2017-05-18 10:57:52

    It should be this reason: Unknown/unsupported storage engine.
    It may also be that the innodb_buffer_pool_size setting is too small.

    reply
    0
  • 高洛峰

    高洛峰2017-05-18 10:57:52

    [ERROR] InnoDB: Cannot allocate memory for the buffer pool
    The error is obvious, just modify your innodb_buffer_pool_size setting.

    reply
    0
  • Cancelreply