mysql启动报错问题

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

 /etc/init.d/mysqld start

Starting 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.cnf中的datadir没有修改指定的路径。

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

注:my.conf里面的内容除需要外,其它的最好都注释掉。

时间: 2024-12-28 18:29:11

mysql启动报错问题的相关文章

MySql启动报错,无法更新PID文件

MySql启动报错 Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql..) 1,查看错误日志 2017-08-10 19:38:14 31865 [Note] InnoDB: Initializing buffer pool, size = 50.0M InnoDB: mmap(53657600 bytes) failed; errno 12 2017-08-10 19:38:14

linux mysql启动报错Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

vi /etc/my.cnf  查看日志文件路径: log-error=/var/log/mysqld.log 查看报错日志: 之前的服务器被别人拿了,所以自己买了台美国vps,根据笔记安装完启动mysql,又启动不了. 查看了错误日志 引用 090321 18:55:03 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/libexec/mysqld: Ta

mysql 启动报错 “mysql-bin.index not found (Errcode: 13)“

安装好mysql数据库后,直接在安装的目录下 /usr/local/mysql  下新建了一个目录data 用于存放数据,建好后,直接去启动数据库,发现启动不了,出现如下报错: mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13) [E

mysql启动报错

mysql启动报错的原因常见的有一下几种: 1.数据所在分区满了 2.pid所在目录mysql用户没有写权限 3.存储引擎为innodb引擎,这个时候启动的时候需要恢复所有的操作(select,create,drop,insert.update,delete),当不能有效的执行恢复操作的时候,mysql启动报错 早上来上班的时候,被通知整栋大楼要停电,想了一下,公司机房还放了几台测试机,如果突然断电的话,会导致测试机中的虚拟机不可用,赶紧一台一台关机吧,其中有一台虚拟机上装着mysql,先进去把

新安装的MySQL启动报错The server quit without updating PID file

安装的MySQL启动报错The server quit without updating PID file [[email protected] mysql]# service mysqld restart MySQL server PID file could not be found!                  [失败] Starting MySQL.The server quit without updating PID file (/[失败]ysql/l ocalhost.loc

mysql启动报错:Table 'mysql.host' doesn't exist

今天在安装mysql后,启动时候没有启动成功,查看了下日志报错如下: --------------------------------------------- [[email protected] local]# less /var/log/mysqld.log 1.查看报错信息如下: [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 2.经过查阅资料得知.要敲

Mysql启动报错解决方案:Failed to open log (file './mysql-bin.000901', errno 2)

ps -ef|grep mysql 发现里边没有mysql进程,于是进行重启. service mysqld start报错 查看错误日志 tail -100 /usr/local/mysql/var/iZ11yohng9aZ.err(主机名.err) 180223 15:31:51 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var 180223 15:31:51 InnoDB: The Inn

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

[[email protected] data]# /etc/init.d/mysqld startStarting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/data/uz6542.pid). 解决方法:初始化mysql /usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/d

mysql启动报错:Starting MySQL... ERROR! The server quit without updating PID file

mysql启动时报错:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid) 的解决方法: 首先看一下我的mysql的配置文件的配置: cat /usr/local/mysql/my.cnf [mysqld] basedir = /usr/local/mysql datadir = /opt/mysql/data port = 3306 server_id = 1

mysql启动报错:Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

mysql在首次启动的时候可能会报错:Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist 这时候可以执行脚本 mysql_install_db –user=mysql –ldata=数据存放的路径