VPS侦探论坛

 找回密码
 注册
查看: 6134|回复: 4

Mysql修改数据存储目录后,出现The server quit without updating PID file错误。

[复制链接]
发表于 2014-5-13 12:08:39 | 显示全部楼层 |阅读模式

因个人需要,重新设置数据库存储位置,系统CentOS-6.4。
1、安装完成LNMP环境,先/root/lnmp stop停止所有相关服务;
2、重新设置了/etc/my.cnf的datadir = /data/mysql/var;
3、/root/lnmp start启动所有相关服务;

此时出现 Starting MySQL...The server quit without updating PID file [失败]/mysql/var/localhost.localdomain.pid).错误,错误日志如下:
  1. 140513 11:59:34 mysqld_safe Starting mysqld daemon with databases from /data/mysql/var
  2. /usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
  3. 140513 11:59:34 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
  4. 140513 11:59:34 InnoDB: The InnoDB memory heap is disabled
  5. 140513 11:59:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  6. 140513 11:59:34 InnoDB: Compressed tables use zlib 1.2.3
  7. 140513 11:59:34 InnoDB: Initializing buffer pool, size = 16.0M
  8. 140513 11:59:34 InnoDB: Completed initialization of buffer pool
  9. InnoDB: The first specified data file /data/mysql/var/ibdata1 did not exist:
  10. InnoDB: a new database to be created!
  11. 140513 11:59:34  InnoDB: Setting file /data/mysql/var/ibdata1 size to 10 MB
  12. InnoDB: Database physically writes the file full: wait...
  13. 140513 11:59:34  InnoDB: Log file /data/mysql/var/ib_logfile0 did not exist: new to be created
  14. InnoDB: Setting log file /data/mysql/var/ib_logfile0 size to 5 MB
  15. InnoDB: Database physically writes the file full: wait...
  16. 140513 11:59:34  InnoDB: Log file /data/mysql/var/ib_logfile1 did not exist: new to be created
  17. InnoDB: Setting log file /data/mysql/var/ib_logfile1 size to 5 MB
  18. InnoDB: Database physically writes the file full: wait...
  19. InnoDB: Doublewrite buffer not found: creating new
  20. InnoDB: Doublewrite buffer created
  21. InnoDB: 127 rollback segment(s) active.
  22. InnoDB: Creating foreign key constraint system tables
  23. InnoDB: Foreign key constraint system tables created
  24. 140513 11:59:35  InnoDB: Waiting for the background threads to start
  25. 140513 11:59:36 InnoDB: 1.1.8 started; log sequence number 0
  26. 140513 11:59:36 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
  27. 140513 11:59:36 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
  28. 140513 11:59:36 [Note] Server socket created on IP: '0.0.0.0'.
  29. 140513 11:59:36 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
  30. 140513 11:59:36 mysqld_safe mysqld from pid file /data/mysql/var/localhost.localdomain.pid ended
复制代码
求解,@军哥。
已经尝试以下方法:

1、kill相关进程,重启mysql问题仍然存在;2、清除mysql-bin.index,重启mysql问题仍然存在;3、
selinux未开启;




谢谢,尝试重做两遍了LNMP 问题依然存在。


[ 本帖最后由 lyongde 于 2014-5-13 12:25 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-5-13 13:33:24 | 显示全部楼层


数据库cp过去的时候部分数据丢失,重新cp
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-5-13 13:45:43 | 显示全部楼层

回复 2# 的帖子


哪一部份,是指初始数据库吗?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2014-5-13 13:49:15 | 显示全部楼层

回复 2# 的帖子




军哥,是指\cp -rf /usr/local/mysql/var/* /data/mysql/var,这样吗,已经这样操作,问题依然存在。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-5-13 14:16:30 | 显示全部楼层

己解决。

按照@军哥提示,重新拷贝初如文件到目录,并且要设置mysql.mysql权限到所有数据库文件,重启即可。

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-15 05:19 , Processed in 0.026521 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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