MySQL无法启动的解决办法

 更新时间:2017年09月11日 09:41:02   作者:codingstandards  
这篇文章主要介绍了MySQL无法启动的解决办法的相关资料,希望通过本文大家能解决数据库不能启动的问题,需要的朋友可以参考下

MySQL无法启动的解决办法

MySQL无法启动

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

[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 

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

[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 ,现在执行多次启动命令都没有问题。

[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 到底是什么,看下:

[root@www ~]$ perror 11 
OS error code 11: Resource temporarily unavailable
[root@www ~]$ 
[root@www ~]$

 如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

相关文章

  • jdbc连接mysq之serverTimezone设定方式

    jdbc连接mysq之serverTimezone设定方式

    这篇文章主要介绍了jdbc连接mysq之serverTimezone设定方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2024-01-01
  • JDBC连接的六步实例代码(与mysql连接)

    JDBC连接的六步实例代码(与mysql连接)

    这篇文章主要给大家介绍了关于JDBC连接的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2021-05-05
  • Django+mysql配置与简单操作数据库实例代码

    Django+mysql配置与简单操作数据库实例代码

    这篇文章主要介绍了Django+mysql配置与简单操作数据库实例,需要的朋友可以参考下
    2017-07-07
  • MySQL优化之Index Merge的使用

    MySQL优化之Index Merge的使用

    本文主要介绍了MySQL优化之Index Merge的使用,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-03-03
  • MySQL [Warning] TIMESTAMP with implicit DEFAULT value is deprecated(报错信息解决)

    MySQL [Warning] TIMESTAMP with implicit&

    本文介绍了MySQL中常见的报错信息及其解决方法,主要包括TIMESTAMP with implicit DEFAULT value is deprecated、ERROR_FOR_DIVISION_BY_ZERO和NO_ZERO_DATE/NO_ZERO_IN_DATE等报错信息,以及对应的配置文件设置和sql_mode修改方法,感兴趣的朋友一起看看吧
    2025-02-02
  • mysql的事务隔离级别详细解析

    mysql的事务隔离级别详细解析

    这篇文章主要介绍了mysql的事务隔离级别详细解析,事务是应用程序中一系列严密的操作,所有操作必须成功完成,否则在每个操作中所作的所有更改都会被撤消,需要的朋友可以参考下
    2023-12-12
  • Linux平台mysql开启远程登录

    Linux平台mysql开启远程登录

    本文给大家分享的是在Linux平台为MySQL开启远程登录连接的方法,有相同需求的小伙伴可以参考下
    2017-02-02
  • MySQL 8忘记密码的最佳处理方式浅析

    MySQL 8忘记密码的最佳处理方式浅析

    这篇文章主要给大家介绍了关于MySQL 8忘记密码的处理方式,文中通过图文介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
    2019-02-02
  • Mysql数据库之索引优化

    Mysql数据库之索引优化

    MySQL凭借着出色的性能、低廉的成本、丰富的资源,已经成为绝大多数互联网公司的首选关系型数据库。本文给大家介绍mysql数据库之索引优化,感兴趣的朋友一起学习吧
    2016-03-03
  • MYSQL 运算符总结

    MYSQL 运算符总结

    这篇文章主要介绍了MYSQL 运算符,MySQL支持的算术运算符有加法、减法、乘法、除法返回商、除法返回余数,下面来看看文章的详细介绍,需要的朋友可以参考一下
    2021-11-11

最新评论