初始化玩数据库之后,使用mysqld_safe启动mysql数据库,如下发现,启动失败
[root@SVNServer bin]# ./mysqld_safe --user=mysql&
[1] 20539
[root@SVNServer bin]# 110806 00:32:19 mysqld_safe Logging to '/usr/local/mysql5.5/data/SVNServer.err'.
110806 00:32:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql5.5/data
110806 00:32:20 mysqld_safe mysqld from pid file /usr/local/mysql5.5/data/SVNServer.pid ended
上面只能看到mysql启动失败,具体的原因,需要查看数据库目录下的.err文件,查看.err文件,内容如下:
110806 00:32:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql5.5/data
^G/usr/local/mysql5.5/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
110806 0:32:20 [ERROR] Aborting
110806 0:32:20 [Note] /usr/local/mysql5.5/bin/mysqld: Shutdown complete
110806 00:32:20 mysqld_safe mysqld from pid file /usr/local/mysql5.5/data/SVNServer.pid ended
红色字标出来的就是这次错误报告,errcode13,一般就是权限问题,mysql用户是否对数据库目录内的所有文件具有写的权限,查看一下权限,如下图
发现问题了,果然是权限问题,下面排错就简单了,将data目录的有所者赋给mysql用户,redhat系统中可以使用,chown mysql.mysql -R data
好了,现在再启动一下mysql,如下图,没有报错
试试,能不能连接,如下图,OK
转载自:点击打开链接