mysql时不时挂掉,无法启动,请问是什么原因啊?
my.cnf配置:
[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
错误日志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 [注意]Binlog结束
2017-04-21 14:16:49 1480 [注意]关闭插件'分区'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'PERFORMANCE_SCHEMA'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'BLACKHOLE'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_SYS_DATAFILES '
2017-04-21 14:16:49 1480 [注意]关闭插件'INNODB_SYS_TABLESPACES'
2017-04-21 14:16:49 1480 [注意]关闭插件'INNODB_SYS_FOREIGN_COLS'
2017-04-21 14 :16:49 1480 [注意] 关闭插件 'INNODB_SYS_FOREIGN'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_SYS_FIELDS'
2017-04-21 14:16:49 1480 [注意]关闭插件 'INNODB_SYS_COLUMNS'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_SYS_INDEXES'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_SYS_TABLESTATS'
2017 -04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_SYS_TABLES'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_FT_INDEX_TABLE'
2017-04-21 14:16: 49 1480 [注意] 关闭插件 'INNODB_FT_INDEX_CACHE'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_FT_CONFIG'
2017-04-21 14:16:49 1480 [注意] 关闭插件'INNODB_FT_BEING_DELETED'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_FT_DELETED'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_FT_DEFAULT_STOPWORD'
2017-0 4- 21 14:16:49 1480 [注意] 关闭插件 'INNODB_METRICS'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_BUFFER_POOL_STATS'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_BUFFER_PAGE_LRU'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_BUFFER_PAGE'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_CMP_PER_INDEX_RESET'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_CMP_PER_INDEX'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_CMPMEM_RESET'
2017-04-21 14: 16:49 1480 [注意] 关闭插件 'INNODB_CMPMEM'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_CMP_RESET'
2017-04-21 14:16:49 1480 [注意] 关闭down 插件 'INNODB_CMP'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_LOCK_WAITS'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_LOCKS'
2017- 04-21 14:16:49 1480 [注意] 关闭插件 'INNODB_TRX'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'ARCHIVE'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'MyISAM'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'CSV'
2017-04-21 14:16:49 1480 [注意] 关闭插件 ' MRG_MYISAM'
2017-04-21 14:16:49 1480 [注意]关闭插件'MEMORY'
2017-04-21 14:16:49 1480 [注意]关闭插件'sha256_password'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'mysql_old_password'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'mysql_native_password'
2017-04-21 14:16:49 1480 [注意] 关闭插件 'binlog'
2017-04-21 14:16:49 1480 [注意] /alidata/server/mysql/bin/mysqld: 关闭完成
170421 14:16:49 来自 pid 文件 /alidata/server/mysql/data/iZ23czua4kgZ.pid 的 mysqld_safe mysqld 结束
内存不够了 都没看到你配置的mysql内存多少 一般占用os的75%
InnoDB: Cannot allocate memory for the buffer pool
看看这句,内存不够了。你自己百度的话一定要找准错误信息
不设置内存参数innodb_buffer_pool_size的话,5.6以上默认使用128M,内存不够。建议使用低版本5.5或者增加内存
内存的问题,不够用了
应该是这个原因: Unknown/unsupported storage engine。
也可能是innodb_buffer_pool_size设置太小了。
[ERROR] InnoDB: Cannot allocate memory for the buffer pool
错误很明显了,修改您的innodb_buffer_pool_size设置即可。