MySQL无法启动的解决办法示例分享


本文摘自PHP中文网,作者黄舟,侵删。

这篇文章主要介绍了MySQL无法启动的解决办法的相关资料,希望通过本文大家能解决数据库不能启动的问题,需要的朋友可以参考下

MySQL无法启动的解决办法

MySQL无法启动

在停止mysql之后,执行了一些操作(如修改主机名),重新启动 mysql,发现起不来。


1

2

3

4

5

6

7

8

9

10

[root@www ~]$ service mysql start

Starting MySQL..^[[A.................................................................................................. ERROR! The server quit without updating PID file (/disk/mysql/www.pid).

[root@www ~]$ service mysql stop

 ERROR! MySQL server PID file could not be found!

[root@www ~]$ service mysql stop

 ERROR! MySQL server PID file could not be found!

[root@www ~]$ service mysql start

Starting MySQL..................

还是老样子,只好 Ctr+C 掉。

[root@www ~]$

实在是启动不了,看一下日志:/disk/mysql/www.err


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

120608 09:56:17 mysqld_safe Starting mysqld daemon with databases from /disk/mysql

120608 9:56:17 [Note] Plugin 'FEDERATED' is disabled.

120608 9:56:17 InnoDB: The InnoDB memory heap is disabled

120608 9:56:17 InnoDB: Mutexes and rw_locks use InnoDB's own implementation

120608 9:56:17 InnoDB: Compressed tables use zlib 1.2.3

120608 9:56:17 InnoDB: Using Linux native AIO

120608 9:56:17 InnoDB: Initializing buffer pool, size = 128.0M

120608 9:56:17 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.

120608 9:56:17 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

...

好像是原来的 mysqld 并没有停下来。

强制终止 mysqld


1

2

3

4

5

6

7

8

9

10

11

[root@www ~]$ ps -ef|grep mysql

root   4769   1 0 Jun06 ?    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/disk/mysql --pid-file=/disk/mysql/localhost.pid

mysql   4874 4769 0 Jun06 ?    00:04:04 /usr/sbin/mysqld --basedir=/usr --datadir=/disk/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/disk/mysql/localhost.err --pid-file=/disk/mysql/localhost.pid --socket=/disk/mysql/mysql.sock

root   17947   1 0 09:56 pts/1  00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/disk/mysql --pid-file=/disk/mysql/www.pid

mysql  18052 17947 0 09:56 pts/1  00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/disk/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/disk/mysql/www.err --pid-file=/disk/mysql/www.pid --socket=/disk/mysql/mysql.sock

root   18099 17514 0 09:56 pts/1  00:00:00 grep mysql

[root@www ~]$ killall mysqld

[root@www ~]$ killall mysqld

[root@www ~]$ ps -ef|grep mysql

root   18116 17514 0 09:57 pts/1  00:00:00 grep mysql

[root@www ~]$

启动 mysqld ,现在执行多次启动命令都没有问题。


1

2

3

4

5

6

7

8

9

[root@www ~]$ service mysql start

Starting MySQL. SUCCESS!

[root@www ~]$

[root@www ~]$

[root@www ~]$

[root@www ~]$

[root@www ~]$ service mysql start

Starting MySQL SUCCESS!

[root@www ~]$

前面 www.err 文件中显示的 error: 11 到底是什么,看下:


1

2

3

4

[root@www ~]$ perror 11

OS error code 11: Resource temporarily unavailable

[root@www ~]$

[root@www ~]$

以上就是MySQL无法启动的解决办法示例分享的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

mysql设置log-bin失败怎么办

简单总结 mysql 表示日期的数据类型

c#操作mysql数据库的代码实例

mysql怎么进去已有数据库

mysql if else 多条件

mysql深入浅出掌握触发器用法

redis能代替mysql

怎么用cmd进入mysql

mysql安装打不开怎么办

mysql如何导出表的字段和相关属性(附示例)

更多相关阅读请进入《mysql》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...