lyongde 发表于 2014-5-13 12:08:39

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

因个人需要,重新设置数据库存储位置,系统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).错误,错误日志如下:
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 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:34InnoDB: Setting file /data/mysql/var/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140513 11:59:34InnoDB: 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:34InnoDB: 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:35InnoDB: Waiting for the background threads to start
140513 11:59:36 InnoDB: 1.1.8 started; log sequence number 0
140513 11:59:36 Server hostname (bind-address): '0.0.0.0'; port: 3306
140513 11:59:36    - '0.0.0.0' resolves to '0.0.0.0';
140513 11:59:36 Server socket created on IP: '0.0.0.0'.
140513 11:59:36 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求解,@军哥。
已经尝试以下方法:

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



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

[ 本帖最后由 lyongde 于 2014-5-13 12:25 编辑 ]

licess 发表于 2014-5-13 13:33:24

数据库cp过去的时候部分数据丢失,重新cp

lyongde 发表于 2014-5-13 13:45:43

回复 2# 的帖子

哪一部份,是指初始数据库吗?

lyongde 发表于 2014-5-13 13:49:15

回复 2# 的帖子

军哥,是指\cp -rf /usr/local/mysql/var/* /data/mysql/var,这样吗,已经这样操作,问题依然存在。

lyongde 发表于 2014-5-13 14:16:30

己解决。

按照@军哥提示,重新拷贝初如文件到目录,并且要设置mysql.mysql权限到所有数据库文件,重启即可。
页: [1]
查看完整版本: Mysql修改数据存储目录后,出现The server quit without updating PID file错误。