MySQL数据库出现The server quit without updating PID file.

LNMP1.0可以在Linux系统下快速搭建PHP环境,以前操作其它服务器也用过LNMP环境,重未出现过类似错误,现将解决过程记录一下。

一、服务器环境

  操作系统: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故障的错误日志不是很清晰,需要经验和对错误日志分析把控。那啥,数据一定要作好日常备份,发生数据灾难时也有可以恢复的源。

时间: 2024-08-26 21:08:55

MySQL数据库出现The server quit without updating PID file.的相关文章

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

1.一般是权限问题,把用户和组改为mysql就可以了. chown -R mysql:mysql  /var/lib/mysql 2.在启动mysql时报下列错误 [[email protected] ~]# service mysql.server startStarting MySQL......................................The server quit without updating PID file (/var/lib/mysql/mysqld2.c

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

启动时候错误代码:Starting MySQL[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid). ... failed! lnmp作者军哥给的解答是:     这里面没有任何错误信息,按[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid     这个看可能又另外安装了mysql或存在其他

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

在网上找了很多 1.可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data”  然后重新启动mysqld! 2.可能进程里已经存在mysql进程解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9  进程号”杀死,然后重新启动mysqld! 3.

lnmp1.1 转移mysql数据库的问题 MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

1.安装前修改/etc/my.cnf,加入datadir         = /data/mysql/   再执行sed -i 's/skip-locking/skip-external-locking/g' /etc/my.cnf 之后的命令,将里面的给目录加权限修改为你新的目录2.安装后停止mysql,移动/usr/local/mysql/var/ 到新目录,修改/etc/my.cnf ,查找[mysqld]  ,在下面加入datadir         = /data/mysql/  ,给

MySQL提示:The server quit without updating PID file问题的解决办法

今天网站web页面提交内容到数据库,发现出错了,一直提交不了,数找了下原因,发现数据写不进去!第一反应,重启mysql数据库,一直执行中,停止不了也启动不了,直觉告诉我磁盘满了 ! 用df命令查了下,果然磁盘满了,因为当时分区采用系统默认,不知道为什么不能自动扩容!以后在处理这个问题!如图所示: 复制代码 代码如下: [[email protected] ~]# df文件系统                 1K-块      已用      可用 已用% 挂载点/dev/mapper/vg_s

Starting MySQL...The server quit without updating PID file [失败]lib/mysql/localhost.localdomain.pid).

重启了一下服务器,启动后就报以下错误了: 纠结了很久没找到解决办法,后来突然想到修改了mysql的配置文件"/usr/my.cnf" 之前配置默认编码,在配置文件中添加了"default-character-set=utf8" 把这一句删除了,再启动mysql就好了. 在解决这个问题过程中找到的比较好的资料,这里收藏一下: 问题起因:今天做了一件事情:我在VM 上将一数据库的数据文件(/var/lib/mysql整个文件夹)拷贝到另外一台VM上,然后新的VM 上启动

The server quit without updating PID file (/application/mysql/localhost.localdomain.pid).

报错信息: [[email protected] scripts]# /etc/init.d/mysqld start Starting MySQL.. ERROR! The server quit without updating PID file (/application/mysql/localhost.localdomain.pid). [[email protected] scripts]#  [[email protected] scripts]# cat 150506 23:12:

MySQL: Starting MySQL….. ERROR! The server quit without updating PID file

文章来源:http://icesquare.com/wordpress/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file/ 今天启动MySQL 遇见了这个问题,网上搜索,结果各种改文件,删除文件纯属坑爹:在上边的网站上发现了问题的解决方案~老外总结的真不错!拿过来自己学习一下 This step-by-step guide is mainly for FreeBSD, however the idea is

mysql-Starting MySQL..The server quit without updating PID file (/[FAILED]ql/mysql/pid)

凌晨1点,日常刷刷手机中,邮箱短信报警了,瞄了一眼,磁盘什么什么的,没在意,每天几十封邮件,麻木了.早上7点,还没醒,老大给我打电话,网站502了,一个激灵起来登陆网站,发现502了 查看进程,发现mysql出问题了,直接service mysql stop ,service mysql start.数据库  ,然后凉凉了,mysql起不起来 [[email protected] data]# service mysql start Starting MySQL..The server quit