非正常关机之后 再次启动mysql 失败

错误信息如下:

150721 15:45:27 mysqld_safe Starting mysqld daemon with databases from /opt/mysql/data
150721 15:45:27 [Note] Flashcache bypass: disabled
150721 15:45:27 [Note] Flashcache setup error is : ioctl failed

150721 15:45:27 [Note] Plugin 'FEDERATED' is disabled.
150721 15:45:27 [Warning] option 'innodb-additional-mem-pool-size': signed value 200 adjusted to 524288
150721 15:45:27 InnoDB: The InnoDB memory heap is disabled
150721 15:45:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150721 15:45:27 InnoDB: Compressed tables use zlib 1.2.3
150721 15:45:27 InnoDB: Using Linux native AIO
150721 15:45:27 InnoDB: Initializing buffer pool, size = 1.0G
150721 15:45:28 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
150721 15:45:28  InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11

 

解决办法:

[root@192-168-102-57 log]# ps -ef|grep mysql
root     11979     1  0 Jul16 ?        00:00:00 /bin/sh /opt/mysql/bin/mysqld_safe --datadir=/opt/mysql/data --pid-file=/opt/mysql/data/192_168_102_47.sky-mobi.com.hz.bj.pid
mysql    12749 11979  0 Jul16 ?        00:03:19 /opt/mysql/bin/mysqld --basedir=/opt/mysql --datadir=/opt/mysql/data --plugin-dir=/opt/mysql/lib/mysql/plugin --user=mysql --log-error=/opt/mysql/log/alert.log --open-files-limit=65535 --pid-file=/opt/mysql/data/192_168_102_47.sky-mobi.com.hz.bj.pid --socket=/opt/mysql/run/mysql.sock --port=3306
root     29336 29085  0 15:48 pts/1    00:00:00 grep mysql

 

可以看到有其它进程占用了 mysql的data文件夹

kill 掉这些进程之后 再次启动 mysql 正常启动

 

总结: 再启动mysql之前 先查看一下是否有其它的进程 占用mysql的数据文件

如果有则杀掉占用的进程 再启动mysql

 

 

Logo

更多推荐