一、服务器环境

  操作系统: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.的更多相关文章

  1. 深度解析MySQL启动时报“The server quit without updating PID file”错误的原因

    很多童鞋在启动mysql的时候,碰到过这个错误, 首先,澄清一点,出现这个错误的前提是:通过服务脚本来启动mysql.通过mysqld_safe或mysqld启动mysql实例并不会报这个错误. 那么 ...

  2. 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进程 ...

  3. lnmp下启动mysql报错 The server quit without updating PID file

    启动时候错误代码:Starting MySQL[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid ...

  4. 解决mysql启动时报The server quit without updating PID file 的错误(转)

    1.一般是权限问题,把用户和组改为mysql就可以了. chown -R mysql:mysql  /var/lib/mysql 2.在启动mysql时报下列错误 [root@mysqld2 ~]#  ...

  5. 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 ...

  6. MySql启动提示:The server quit without updating PID file(…)失败

    在网上找了很多 1.可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data”  ...

  7. MySQL启动出现The server quit without updating PID file错误解决办法

    启动mysql服务的时候报下面这个错: 之间网上搜了各种办法,有重新初始化的(这怎么可能,里面还有数据...),有修改启动脚本的等等,但是都没用. 其实解决办法非常简单粗暴,那就是把/etc/my.c ...

  8. MySQL提示:The server quit without updating PID file问题的解决办法(转载)

    MySQL提示:The server quit without updating PID file问题的解决办法 今天网站web页面提交内容到数据库,发现出错了,一直提交不了,数找了下原因,发现数据写 ...

  9. MySQL.. ERROR! The server quit without updating PID file问题解决

    不小心将服务器OS给重启了,再启动数据库的时候,出现了很奇怪的问题 [root@dev run]# service mysql restart ERROR! MySQL server PID file ...

随机推荐

  1. jquery取消超链接

  2. EC笔记,第一部分:2.尽量以const,enum,inline代替#define

    02.尽量以const,enum,inline代替#define 原因:编译前的预处理会替换宏,所以调试的时候找不到错误 1.const 尽量用const替代常量宏定义 两种特殊情况: (1).常量指 ...

  3. 怎样实现了捕获应用中的日志在android开发中

    怎样实现了捕获应用中的日志在android开发中,大家可研究一下. Process mLogcatProc = null; BufferedReader reader = null; try { mL ...

  4. [python拾遗]异常处理

    异常 异常(Exception)是因为程序的例外.违例.出错等情况而在正常控制流以外采取的行为,一般分为如下两个阶段: 1.异常发生:一个错误发生后被打印出来,称为未处理异常,而默认的处理则是自动输出 ...

  5. 【Effective Java】10、java注解使用

    package cn.xf.cp.ch02.item35; import java.lang.annotation.ElementType; import java.lang.annotation.R ...

  6. 两个实用的方法从Base64字符串生成RSAPublicKey及RSAPrivatekey

    public static RSAPublicKey getRSAPublidKeyBybase64(String base64s) { X509EncodedKeySpec keySpec = ne ...

  7. [转载][翻译] IoC 容器和 Dependency Injection 模式

    原文地址:Inversion of Control Containers and the Dependency Injection pattern 中文翻译版本是网上的PDF文档,发布在这里仅为方便查 ...

  8. AWS CloudFront CDN直接全站加速折腾记The request could not be satisfied. Bad request

    ERROR The request could not be satisfied. Bad request. Generated by cloudfront (CloudFront) Request ...

  9. SQL SERVER常用定义查询

    https://msdn.microsoft.com/en-us/library/ms175081.aspx

  10. Dense.js - 响应式的视网膜(Rtina)图像支持

    Dense 是一款 jQuery 插件,它提供一个简单的方法为设备提供精密像素比的图像,为你的网站带来视网膜支持,清除模糊,图像更清晰.通过简单地包括 jQuery 插件的页面上,就能实现响应式的视网 ...