您的位置:首页技术文章
文章详情页

mysql-配置 - MySQL错误,时不时自动挂掉,无法启动

【字号: 日期:2022-06-12 14:49:09浏览:22作者:猪猪

问题描述

mysql时不时挂掉,无法启动,请问是什么原因啊?

my.cnf配置:

[client]port = 3306socket = /tmp/mysql.sock[mysqld]port = 3306socket = /tmp/mysql.sockskip-external-lockinglog-error=/alidata/log/mysql/error.logkey_buffer_size = 16Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8Mskip-name-resolve

log-bin=mysql-binbinlog_format=mixedserver-id = 1

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqldump]quickmax_allowed_packet = 16M

[mysql]no-auto-rehash

[myisamchk]key_buffer_size = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M

[mysqlhotcopy]interactive-timeoutexpire_logs_days = 5max_binlog_size = 1000M

错误日志log:170421 14:16:49 mysqld_safe Number of processes running now: 0170421 14:16:49 mysqld_safe mysqld restarted2017-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 pages2017-04-21 14:16:49 1480 [Note] InnoDB: The InnoDB memory heap is disabled2017-04-21 14:16:49 1480 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2017-04-21 14:16:49 1480 [Note] InnoDB: Memory barrier is not used2017-04-21 14:16:49 1480 [Note] InnoDB: Compressed tables use zlib 1.2.32017-04-21 14:16:49 1480 [Note] InnoDB: Using Linux native AIO2017-04-21 14:16:49 1480 [Note] InnoDB: Using CPU crc32 instructions2017-04-21 14:16:49 1480 [Note] InnoDB: Initializing buffer pool, size = 128.0MInnoDB: mmap(137363456 bytes) failed; errno 122017-04-21 14:16:49 1480 [ERROR] InnoDB: Cannot allocate memory for the buffer pool2017-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: InnoDB2017-04-21 14:16:49 1480 [ERROR] Aborting

2017-04-21 14:16:49 1480 [Note] Binlog end2017-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

问题解答

回答1:

内存不够了 都没看到你配置的mysql内存多少 一般占用os的75%

回答2:

InnoDB: Cannot allocate memory for the buffer pool

看看这句,内存不够了。你自己百度的话一定要找准错误信息

回答3:

不设置内存参数innodb_buffer_pool_size的话,5.6以上默认使用128M,内存不够。建议使用低版本5.5或者增加内存

回答4:

内存的问题,不够用了

回答5:

应该是这个原因: Unknown/unsupported storage engine。也可能是innodb_buffer_pool_size设置太小了。

回答6:

[ERROR] InnoDB: Cannot allocate memory for the buffer pool错误很明显了,修改您的innodb_buffer_pool_size设置即可。