mysql 启动失败问题处理备忘

mysql 启动的时候报错

Starting MySQL.The server quit without updating PID file (/[失败]b/mysql/uhza00****.hichina.com.pid).

mysql安装过,启动报错,还是第一次碰到.有点慌....

查看日志  

/var/log/mysqld.log

150627 22:18:17 InnoDB: Completed initialization of buffer pool

150627 22:18:17  InnoDB: Operating system error number 13 in a file operation.

InnoDB: The error means mysqld does not have the access rights to

InnoDB: the directory.

InnoDB: File name /data/mysql/ibdata2

InnoDB: File operation call: 'open'.

InnoDB: Cannot continue operation.

150627 22:18:17 mysqld_safe mysqld from pid file /var/lib/mysql/uhza00*****.hichina.com.pid ended

150627 22:19:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

发现是没有访问权限.

记起来/data目录的权限有修改过,修改为nobody

在 /data/mysql 目录中数据文件权限修改为root 但是仍然报错.

后来想想 是使用mysql的用户安装的. 将/data/mysql 目录中数据文件 修改为mysql然后启动. 成功了

[root@uhza00**** home]# ps -ef | grep mysql

root      7464     1  0 22:19 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/uhza00****.hichina.com.pid

mysql     7748  7464  0 22:19 pts/1    00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/lib/mysql/uhza00****.hichina.com.pid --socket=/var/lib/mysql/mysql.sock

相关推荐