MySQL数据库出现The server quit without updating PID file.
一、服务器环境
操作系统:CentOS-6.4
服务器环境:集成环境LNMP1.0
二、步骤重现
1、安装LNMP1.0,具体操作方法见这里,安装成功;
2、因个人需求,现将MySQL数据库存放在/data/mysql/var,修改/etc/my.cnf的datadir=/data/mysql/var,别忘了将/var目录的权限设置为chown -R mysql.mysql /data/mysql;
3、重启服务,/root/lnmp restart;
4、提示错误:Starting MySQL...The server quit without updating PID file [失败]/mysql/var/localhost.localdomain.pid).;
三、解决错误
1、根据提示可能是PID的错误,按照常规解决方法kill相关进程、清除selinux,问题仍然存在;
2、查看错误日志,/usr/local/mysql/var/localhost.localdomain.pid

140513 11:59:34 mysqld_safe Starting mysqld daemon with databases from /data/mysql/var
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
140513 11:59:34 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140513 11:59:34 InnoDB: The InnoDB memory heap is disabled
140513 11:59:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140513 11:59:34 InnoDB: Compressed tables use zlib 1.2.3
140513 11:59:34 InnoDB: Initializing buffer pool, size = 16.0M
140513 11:59:34 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file /data/mysql/var/ibdata1 did not exist:
InnoDB: a new database to be created!
140513 11:59:34 InnoDB: Setting file /data/mysql/var/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140513 11:59:34 InnoDB: Log file /data/mysql/var/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /data/mysql/var/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
140513 11:59:34 InnoDB: Log file /data/mysql/var/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /data/mysql/var/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
140513 11:59:35 InnoDB: Waiting for the background threads to start
140513 11:59:36 InnoDB: 1.1.8 started; log sequence number 0
140513 11:59:36 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140513 11:59:36 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140513 11:59:36 [Note] Server socket created on IP: '0.0.0.0'.
140513 11:59:36 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
140513 11:59:36 mysqld_safe mysqld from pid file /data/mysql/var/localhost.localdomain.pid ended

3、根据日志提示,可能是mysql.plugin数据表不存在,拷贝原数据库目录/usr/local/mysql/var/*到/data/mysql/var/,重启mysql服务/etc/init.d/mysql start,发现问题仍然存在;
4、返回数据库目录查看数据权限发现全是root.root,重新设置数据权限:chown mysql.mysql /data/mysql/,重启mysql服务/etc/init.d/mysql start,问题解决。;
四、总结
在配置Linux环境出现错误再所难免,MySQL故障的错误日志不是很清晰,需要经验和对错误日志分析把控。那啥,数据一定要作好日常备份,发生数据灾难时也有可以恢复的源。
MySQL数据库出现The server quit without updating PID file.的更多相关文章
- 深度解析MySQL启动时报“The server quit without updating PID file”错误的原因
很多童鞋在启动mysql的时候,碰到过这个错误, 首先,澄清一点,出现这个错误的前提是:通过服务脚本来启动mysql.通过mysqld_safe或mysqld启动mysql实例并不会报这个错误. 那么 ...
- Mysql 启动遇到 The server quit without updating PID file (/[FAILED]l/mysql/data/021rjsh216086s.pid)和Attempted to open a previously opened tablespace
今天在测试服务器做调试的时候,遇到Mysql的启动问题,好像是PID文件找不到了. 不科学啊,前几天还好好的呀,我也没怎么乱搞啊,然后一通百度,找到了几个解决办法. 1.有可能是已经存在mysql进程 ...
- lnmp下启动mysql报错 The server quit without updating PID file
启动时候错误代码:Starting MySQL[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid ...
- 解决mysql启动时报The server quit without updating PID file 的错误(转)
1.一般是权限问题,把用户和组改为mysql就可以了. chown -R mysql:mysql /var/lib/mysql 2.在启动mysql时报下列错误 [root@mysqld2 ~]# ...
- mac mysql start ERROR! The server quit without updating PID file
在mac下安装完mysql,启动时出现error: ERROR! The server quit without updating PID file (/usr/local/var/mysql/nal ...
- MySql启动提示:The server quit without updating PID file(…)失败
在网上找了很多 1.可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data” ...
- MySQL启动出现The server quit without updating PID file错误解决办法
启动mysql服务的时候报下面这个错: 之间网上搜了各种办法,有重新初始化的(这怎么可能,里面还有数据...),有修改启动脚本的等等,但是都没用. 其实解决办法非常简单粗暴,那就是把/etc/my.c ...
- MySQL提示:The server quit without updating PID file问题的解决办法(转载)
MySQL提示:The server quit without updating PID file问题的解决办法 今天网站web页面提交内容到数据库,发现出错了,一直提交不了,数找了下原因,发现数据写 ...
- MySQL.. ERROR! The server quit without updating PID file问题解决
不小心将服务器OS给重启了,再启动数据库的时候,出现了很奇怪的问题 [root@dev run]# service mysql restart ERROR! MySQL server PID file ...
随机推荐
- 广义表 Head Tail
head:取非空广义表的第一个元素 tail:取非空广义表除第一个元素外剩余元素构成的广义表 L=((x,y,z),a,(u,t,w)) head(L)为(x,y,z) head(head(L))为x ...
- 最近Google经常打不开?
最近听好多同事讲google打不开,无法进行搜索,用了代理之后速度还是很慢,而百度搜索又不佳… 就在此分享一些google地址: 个人收藏夹的: 203.208.46.144(这段时间推荐使用这4个地 ...
- Tsung测试Tigase
用两台主机坐Tigase的Tsung测试,其中1台运行Tigase,另1台运行Tsung. 1.Tigase服务器设置 tigase.conf: #osgiEnabled=(true|false) # ...
- Android发送短信
// 发送短信 public void sendMsg(){ String content = edtSend.getText().toString(); SmsManager smsManager ...
- Widget的点击事件
本文实现Widget中的按钮点击事件,点击一次下面的按钮,上面的数字减少1. 首先是Manifest文件: <?xml version="1.0" encoding=&quo ...
- Git submodule 特性
当你习惯了代码的 VCS 后,基本上是离不开的. 作为一个依赖多个子项目组成的项目,要实现直观的代码逻辑结构,可以考虑使用 Git submodule 特性. 当然,如果只是单独的依赖的话,用依赖管理 ...
- Sublime搭建Python开发环境
print ('hello world!') 1. 下载python,并设置path系统环境变量:当在命令行中输入python,出现如下界面,显示安装成功. 2. 安装最新的sublime,使用注册机 ...
- 快速熟悉Velocity
果然公司用的东西跟平时学的东西不太一样,我们公司前台页面并不是我们熟悉的.html或者.jsp文件,而是很多人不知道的 .vm文件,其实只要我们理解了jsp文件,vm文件也就是一些基本语法不同而已. ...
- java.lang.IllegalStateException: Recursive entry to executePendingTransactions
[解决办法]: 将getFragmentManager改为getChildFragmentManager即可
- lodash链式使用
chain var _ = require('lodash'); var user1 = { name: 'zhangsan', height: 180, weight: 120 }; var use ...