谁能帮忙解决一下,最近mysql老是自己就挂了,郁闷

dishuipinganye 发布于 2016/08/27 21:17
阅读 1K+
收藏 0

这是错误日志

d_safe mysqld from pid file /alidata/server/mysql/data/iZ25sy460ijZ.pid ended

160827 20:34:24 mysqld_safe Starting mysqld daemon with databases from /alidata/server/mysql/data
2016-08-27 20:34:26 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-27 20:34:26 31137 [Note] Plugin 'FEDERATED' is disabled.
2016-08-27 20:34:26 31137 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-27 20:34:26 31137 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-27 20:34:26 31137 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-27 20:34:26 31137 [Note] InnoDB: Memory barrier is not used
2016-08-27 20:34:26 31137 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-27 20:34:26 31137 [Note] InnoDB: Using Linux native AIO
2016-08-27 20:34:26 31137 [Note] InnoDB: Using CPU crc32 instructions
2016-08-27 20:34:26 31137 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-27 20:34:26 31137 [Note] InnoDB: Completed initialization of buffer pool
2016-08-27 20:34:26 31137 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-27 20:34:26 31137 [Note] InnoDB: The log sequence numbers 1626719 and 1626719 in ibdata files do not match the log sequence number 1626729 in the ib_logfiles!
2016-08-27 20:34:26 31137 [Note] InnoDB: Database was not shutdown normally!
2016-08-27 20:34:26 31137 [Note] InnoDB: Starting crash recovery.
2016-08-27 20:34:26 31137 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-08-27 20:34:26 31137 [Note] InnoDB: Restoring possible half-written data pages 
2016-08-27 20:34:26 31137 [Note] InnoDB: from the doublewrite buffer...
2016-08-27 20:34:26 31137 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-27 20:34:26 31137 [Note] InnoDB: Waiting for purge to start
2016-08-27 20:34:26 31137 [Note] InnoDB: 5.6.21 started; log sequence number 1626729
2016-08-27 20:34:26 31137 [Note] Recovering after a crash using mysql-bin
2016-08-27 20:34:26 31137 [Note] Starting crash recovery...
2016-08-27 20:34:26 31137 [Note] Crash recovery finished.
2016-08-27 20:34:27 31137 [Note] Server hostname (bind-address): '*'; port: 3306
2016-08-27 20:34:27 31137 [Note] IPv6 is not available.
2016-08-27 20:34:27 31137 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2016-08-27 20:34:27 31137 [Note] Server socket created on IP: '0.0.0.0'.
2016-08-27 20:34:27 31137 [Note] Event Scheduler: Loaded 0 events
2016-08-27 20:34:27 31137 [Note] /alidata/server/mysql/bin/mysqld: ready for connections.
Version: '5.6.21-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)
160827 20:39:19 mysqld_safe Number of processes running now: 0
160827 20:39:19 mysqld_safe mysqld restarted
2016-08-27 20:39:21 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-27 20:39:21 31441 [Note] Plugin 'FEDERATED' is disabled.
2016-08-27 20:39:21 31441 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-27 20:39:21 31441 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-27 20:39:21 31441 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-27 20:39:21 31441 [Note] InnoDB: Memory barrier is not used
2016-08-27 20:39:21 31441 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-27 20:39:21 31441 [Note] InnoDB: Using Linux native AIO
2016-08-27 20:39:21 31441 [Note] InnoDB: Using CPU crc32 instructions
2016-08-27 20:39:21 31441 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2016-08-27 20:39:21 31441 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2016-08-27 20:39:21 31441 [ERROR] Plugin 'InnoDB' init function returned error.
2016-08-27 20:39:21 31441 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-08-27 20:39:21 31441 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-08-27 20:39:21 31441 [ERROR] Aborting


2016-08-27 20:39:21 31441 [Note] Binlog end
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'partition'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'BLACKHOLE'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_METRICS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_CMP'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'INNODB_TRX'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'ARCHIVE'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'MyISAM'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'CSV'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'MRG_MYISAM'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'MEMORY'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'sha256_password'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'mysql_old_password'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'mysql_native_password'
2016-08-27 20:39:21 31441 [Note] Shutting down plugin 'binlog'
2016-08-27 20:39:21 31441 [Note] /alidata/server/mysql/bin/mysqld: Shutdown complete
加载中
1
逝水fox
逝水fox

errno 12 是Linux的系统错误码值,说明128M操作系统都无法完成分配,改成200M更不可能分配得了。需检查一下你系统的内存是否够用(128M应该很小现在的服务器不应该出现无法分配),是否限制了mysql运行用户的内存使用,另外需要考虑操作系统以及mysql是否为32位系统。

最后使用top、mysqladmin -uroot -r -i 1 -proot extended-status检查系统状态和my.cnf配置文件是否因为其他的进程或MySQL内存其他区域设置导致内存被大量占用

0
naryli
naryli

看到这句没,没能分配足够的内存给缓冲池。看看内存大小吧

initializing buffer pool, size = 128.0M

InnoDB: mmap(137363456 bytes) failed; errno 12
2016-08-27 20:39:21 31441 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
dishuipinganye
dishuipinganye
只是不知道怎么解决,我百度了一下,配置文件 加了两行 innodb_buffer_pool_size=200M key_buffer=120M 但过会儿还是会挂
0
迷茫的中年IT狗
迷茫的中年IT狗
估计内存不够用,先把没必要的日志文件删掉试试,关闭log-bin
0
dishuipinganye
dishuipinganye

这是mysql的配置文件,大侠帮忙看下 

[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


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 


会不会跟缓冲的配置有关

0
携剑的路人
一般来说是内存不足,我们的JAVA服务器老把MySQL挤死
0
vga
vga
恢复默认配置试一下
返回顶部
顶部