Home > Database > Mysql Tutorial > MySQL启动报错解决案例

MySQL启动报错解决案例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:08:49
Original
1268 people have browsed it

新安装的一台CentOS服务器,安装完LAMP后,重启了一下系统,发现MySQL启动不了并报如下的错误: /etc/init.d/mysqld startStarti

新安装的一台CentOS服务器,安装完LAMP后,,重启了一下系统,发现MySQL启动不了并报如下的错误:

 /etc/init.d/mysqld startStarting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/feixiag.pid).
 
查看日志如下:InnoDB: Apply batch completed
2015-03-18 17:28:05 24592 [Note] InnoDB: 128 rollback segment(s) are active.
2015-03-18 17:28:05 24592 [Note] InnoDB: Waiting for purge to start
2015-03-18 17:28:05 24592 [Note] InnoDB: 5.6.21 started; log sequence number 1600607
2015-03-18 17:28:05 24592 [Note] Server hostname (bind-address): '*'; port: 3306
2015-03-18 17:28:05 24592 [Note] IPv6 is available.
2015-03-18 17:28:05 24592 [Note]  - '::' resolves to '::';
2015-03-18 17:28:05 24592 [Note] Server socket created on IP: '::'.
2015-03-18 17:28:05 24592 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
150318 17:28:05 mysqld_safe mysqld from pid file /var/lib/mysql/feixiag.pid ended
 
google,百度后,也没有找到好的方法,突然想起,我在初始化数据库的时候指定了datadir的路径为/data/mysql,而在/etc/my.conf中的datadir没有修改指定的路径。

查看/etc/my.conf,果然是没有更改,改为datadir=/data/mysql 后,启动成功。

本文永久更新链接地址

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template