VPS侦探论坛

 找回密码
 注册
查看: 5854|回复: 9

LNMP V0.7 MySQL 挂了

[复制链接]
发表于 2013-9-24 15:59:14 | 显示全部楼层 |阅读模式

=========================================================================
Manager for LNMP V0.7  ,  Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Nginx is runing!
php-fpm is stop!
/etc/init.d/mysql: line 419: test: 4054: binary operator expected
MySQL is running but PID file could not be found           [FAILED]

我Linode重启后就出现这样的情况,现在只能root登陆。用到数据库的地方包括ftp都挂了。
有什么方法啊,或者能拿到数据库中的数据也行啊。
谢谢军哥。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-9-24 16:54:14 | 显示全部楼层


ERROR! MySQL is running but PID file could not be found ?

出现这个问题原因很多
最常见的通常是PID进程未全部关闭
比如启动safe mysqld进程后
未关闭

运行 /etc/init.d/mysql status
会提示
ERROR! MySQL is running but PID file could not be found

先打印MYSQL进程
ps aux | grep mysql

然后KILL进程
kill -9 pid1 pid2 …

在启动MYSQL
/etc/init.d/mysql start

在检查
/etc/init.d/mysql status
SUCCESS! MySQL running (10021)

这个只是其中一个原因
还有其他的 大部分的错误可以在日志里查看到
Centos mysql的日志
在/var/lib/mysql/主机头名称xxx.err
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-9-24 16:56:33 | 显示全部楼层

ySQL is running but PID file could not be found

表现为mysql不能关闭也不能重启

查看启动脚本/etc/init.d/msyql.server 可以发现:
由于pid默认为mysql/data/hostname.pid
若在mysql运行期间修改hostname,再操作mysql则会出现此错误.

如何解决:
查找mysql data下的pid文件,找到原hostname

修改回去关闭mysql,重新改hostname即可.
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-9-24 17:31:36 | 显示全部楼层



原帖由 puffbaby 于 2013-9-24 16:54 发表
ERROR! MySQL is running but PID file could not be found ?

出现这个问题原因很多
最常见的通常是PID进程未全部关闭
比如启动safe mysqld进程后
未关闭

运行 /etc/init.d/mysql status
会提示
ERROR! MySQL is r ...

[root@li379-78 ~]# ps aux | grep mysql
root      3103  0.0  0.2   4680  1216 ?        S    Sep23   0:00 /bin/sh /usr/lo       cal/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/m       ysql/var/li379-78.pid
mysql     3207  0.0  1.0  34152  5152 ?        S    Sep23   0:00 /usr/local/mysq       l/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --use       r=mysql --log-error=/usr/local/mysql/var/li379-78.err --pid-file=/usr/local/mysq       l/var/li379-78.pid --socket=/tmp/mysql.sock --port=3306
root      3951  0.0  0.2   4632  1136 ?        S    15:16   0:00 /bin/sh /usr/lo       cal/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/m       ysql/var/li379-78.pid
mysql     4054  0.0  0.9  34152  5020 ?        S    15:16   0:00 /usr/local/mysq       l/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --use       r=mysql --log-error=/usr/local/mysql/var/li379-78.err --pid-file=/usr/local/mysq       l/var/li379-78.pid --socket=/tmp/mysql.sock --port=3306
root      8706  0.0  0.1   4044   668 pts/0    S+   17:24   0:00 grep mysql

然后我该怎么操作kill 3103
kill 3207
kill 3951
kill 4054
kill 8706
再运行运行 /etc/init.d/mysql status
也还是一样显示出来么

[ 本帖最后由 aedisju 于 2013-9-24 17:45 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-9-25 08:21:44 | 显示全部楼层

置顶帖问题反馈有要求,提供mysql日志

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2013-9-25 15:45:37 | 显示全部楼层

原帖由 licess 于 2013-9-25 08:21 发表
置顶帖问题反馈有要求,提供mysql日志
服务商:Linode
系统:CenterOS 5.6 32bit
版本:lnmp0.7
不是新装,已经运行了很长时间了,应该是0.7出来后至今吧。
mysql运行不正常的话,提供/usr/local/mysql/var/主机名.err 的日志。

已经传到附件。

PHP-FPM挂了,PHP 5.2 提供 /usr/local/php/logs/php-fpm.log的日志;PHP 5.3提供/usr/local/php/var/log/php-fpm.log 的日志。

找到
/usr/local/php/logs/php-fpm.log的日志,但是里面没任何内容。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2013-9-25 19:56:42 | 显示全部楼层

/usr/local/mysql/libexec/mysqld: Retry in 60 secs. Message reprinted in 600 secs
130924 17:33:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
/usr/local/mysql/libexec/mysqld: Disk is full writing './mysql-bin.~rec~' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space)

当前分区或磁盘已满
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-9-26 15:18:59 | 显示全部楼层

原帖由 licess 于 2013-9-25 19:56 发表
/usr/local/mysql/libexec/mysqld: Retry in 60 secs. Message reprinted in 600 secs
130924 17:33:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
/usr/local/mysql/libexec/my ...
自己的几个小网站不太会增加文件大小,lnmp的日志增加的大么?如果大,怎么删除。准备先可以用,导出sql,然后装个lnmp1.0啦
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-9-26 15:30:16 | 显示全部楼层
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-9-26 18:29:02 | 显示全部楼层



原帖由 licess 于 2013-9-26 15:30 发表
https://bbs.vpser.net/thread-8393-1-1.html

解决了,果然是硬盘满了,删除了日志。谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 01:21 , Processed in 0.029625 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表