mysql 有报错  ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

sh-4.1# /etc/init.d/mysqld status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
sh-4.1# /etc/init.d/mysqld start
Starting MySQL. ERROR! The server quit without updating PID file (/data1/mysql/mysql.pid).
sh-4.1# rm mysql
sh-4.1# /etc/init.d/mysqld status
ERROR! MySQL is not running
sh-4.1# /etc/init.d/mysqld start
Starting MySQL. ERROR! The server quit without updating PID file (/data1/mysql/mysql.pid).

看了一下mysql的日志有如下错误:

  :: [Note] /apps/mysql-5.5./bin/mysqld: Shutdown complete

 :: mysqld_safe mysqld from pid file /data1/mysql/mysql.pid ended
:: mysqld_safe Starting mysqld daemon with databases from /data1/mysql/
:: [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
:: [Note] Plugin 'FEDERATED' is disabled.
:: InnoDB: The InnoDB memory heap is disabled
:: InnoDB: Mutexes and rw_locks use GCC atomic builtins
:: InnoDB: Compressed tables use zlib 1.2.
:: InnoDB: Using Linux native AIO
:: InnoDB: Initializing buffer pool, size = .0G
InnoDB: mmap( bytes) failed; errno
:: InnoDB: Completed initialization of buffer pool
:: InnoDB: Fatal error: cannot allocate memory for the buffer pool
:: [ERROR] Plugin 'InnoDB' init function returned error.
:: [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
:: [ERROR] Unknown/unsupported storage engine: InnoDB
:: [ERROR] Aborting :: [Note] /apps/mysql-5.5./bin/mysqld: Shutdown complete :: mysqld_safe mysqld from pid file /data1/mysql/mysql.pid ended

从err日志,可以看出,我分配的Initializing buffer pool, size = 2.0G,使得机器无法初始化。导致mysql启动不起来。

这个值=>my.cnf的innodb_buffer_pool_size

sh-4.1# grep "innodb-buffer-pool-size" /etc/my.cnf
innodb-buffer-pool-size = 1G
#innodb-buffer-pool-size = 2G

问题解决启动成功!!!!

上一篇:SQL中EXISTS的用法和效率


下一篇:Android(java)学习笔记157:使用Dexdump等工具进行反编译