MySQL 启动报错:File ./mysql-bin.index not found (Errcode: 13)_MySQL
[root@SVNServer bin]# ./mysqld_safe –user=mysql&
或
[root@SVNServer bin]# /etc/init.d/mysqld start
Starting MySQL. ERROR! The server quit without updating PID file (/data/mysql/AY14020816093477605eZ.pid).
重启mysql会抛出上面红色字体的错误。
上面只能看到mysql启动失败,具体的原因,需要查看数据库目录下的.err文件,查看.err文件,内容如下:
140726 00:18:10 mysqld_safe mysqld from pid file /data/mysql/AY14020816093477605eZ.pid ended
140726 00:31:19 mysqld_safe Starting mysqld daemon with databases from /data/mysql
/usr/local/mysql/bin/mysqld: File ‘./mysql-bin.index' not found (Errcode: 13)
140726 0:31:19 [ERROR] Aborting
140726 0:31:19 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
红色字标出来的就是这次错误报告,errcode13,一般就是权限问题,mysql用户是否对数据库目录内的所有文件具有写的权限,查看一下权限,修改MySQL目录的用户和用户组权限:
chown -R mysql:mysql /usr/local/mysql
在查看/usr/local/mysql目录权限,如下图
发现问题了,果然是权限问题,下面排错就简单了,将data目录的有所者赋给mysql用户
redhat系统中可以使用 :chown mysql.mysql -R /usr/local/mysql
CentOS系统中可以使用:chown mysql:mysql -R /usr/local/mysql
好了,现在再启动一下mysql,如下图,没有报错
[root@SVNServer bin]# /etc/init.d/mysqld start
如果仍然报错,可能就是 /usr/local/mysql 目录的权限设置问题,设置其权限如下:
chmod 755 /usr/local/mysql
设置后查看权限如下: ll /usr/local/mysql
drwxr-xr-x 9 mysql mysql 12288 7月 26 09:50 mysql
试试,能不能连接,如下图,OK
推荐阅读
-
MySQL4 File ‘c:\mysql\share\charsets\?.conf’ not found (Errcode: 22)的解决方法
-
MySQL4 File ‘c:\mysql\share\charsets\?.conf’ not found (Errcode: 22)的解决方法
-
MySQL4 File ‘c:\mysql\share\charsets\?.conf’ not found (Errcode: 22)的解决方法
-
MySQL4 File ‘c:\mysql\share\charsets\?.conf’ not found (Errcode: 22)的解决方法
-
MySQL4 File ‘c:\mysql\share\charsets\?.conf’ not found (Errcode: 22)的解决方法
-
linux启动mysql报错 Starting MySQL... ERROR! The server quit without updating PID file (XXXX pid文件位置)
-
MySQL4 File ‘c:\mysql\share\charsets\?.conf’ not found (Errcode: 22)的解决方法
-
启动mysql时报错:ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists的解决办法
-
Tomcat启动报错 No suitable driver found for jdbc:mysql://localhost:3306……
-
MySQL启动ERROR! MySQL server PID file could not be found的解决办法