Linux下安装初始化完MySQL数据库之后,使用mysqld_safe启动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

MySQL 启动报错:File ./mysql-bin.index not found (Errcode: 13)的更多相关文章

  1. mysql启动报错,与selinux相关

    mysql启动报错,与selinux相关 如果遇到报错,可能的情况是 selinux 的关系,可以安装 setroubleshoot-server 工具,使用 sealert -a /var/log/ ...

  2. mysql 启动报错Host name could not be resolved解决办法

    mysql 启动报错信息如下: [root@xxx ~]# 2018-01-26 17:06:35 33 [Warning] Host name 'bogon' could not be resolv ...

  3. 树莓派(Raspberry Pi 3) centos7使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

    使用yum命令报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid ...

  4. yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

    使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: 问题出现原因:yum包管理是使用python2 ...

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

    [root@uz6542 data]# /etc/init.d/mysqld startStarting MySQL... ERROR! The server quit without updatin ...

  6. ubuntu 下安装 mysql 启动报错:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    环境: ubuntu LTS 18.04.1 mysql Ver 14.14 Distrib 5.7.29, for Linux (x86_64) 初探 linux,按照如下安装完mysql sudo ...

  7. Eclipse启动报错Java was started but returned exit code=13

    启动Eclipse的时候报错Java was started but returned exit code=13,这个错误的原因是由于eclipse版本与jdk版本不符导致的,可能你的eclipse是 ...

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

    在mysql的data目录下误删除了mysql-bin.000001,mysql-bin.000002等文件,但是没有删除mysql-bin.index文件,此时启动mysql就会报错: Starti ...

  9. mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file

    mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...

随机推荐

  1. Excel VBA基础教程

    https://www.w3cschool.cn/excelvba/excelvba-basics.html Excel VBA语言基础 VBA语言的基础认识 详解VBA编程是什么 excel处理录制 ...

  2. greenplum /postgres 登陆以及创建修改用户密码

    1.greenplum 启动 bin目录下的gpstart  ,-m为只启动master 2.greenplum 启动之后,通过postgresql登陆 登陆命令:PGOPTIONS="-c ...

  3. lucas定理 +证明 学习笔记

    lucas定理 p为素数 \[\dbinom n m\equiv\dbinom {n\%p} {m\%p} \dbinom {n/p}{m/p}(mod p)\] 左边一项直接求,右边可递归处理,不包 ...

  4. JavaWeb学习总结(十二)——Session(转)

    一.Session简单介绍 在WEB开发中,服务器可以为每个用户浏览器创建一个会话对象(session对象),注意:一个浏览器独占一个session对象(默认情况下).因此,在需要保存用户数据时,服务 ...

  5. 转 Python爬虫入门五之URLError异常处理

    静觅 » Python爬虫入门五之URLError异常处理 1.URLError 首先解释下URLError可能产生的原因: 网络无连接,即本机无法上网 连接不到特定的服务器 服务器不存在 在代码中, ...

  6. declaration specifier, declarator, type specifier

    static struct abc * b; static struct abc : declaration specifier * b : declarator struct abc : type ...

  7. Xcode 如何计算整个项目的代码行数

    参考链接:https://www.cnblogs.com/sunfuyou/p/7921538.html 1.打开终端 2.cd 空格 将工程的文件夹拖到终端上,回车,此时进入到工程的路径 此时已经进 ...

  8. js对象定义的最常用的三种方法

    定义对象:属性和方法的结合体(变量和函数的结合体) 1.(***)var obj = {} 2.var obj = new Object(); 3.使用function定义对象 具体例子分别为: // ...

  9. BZOJ——1620: [Usaco2008 Nov]Time Management 时间管理

    Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 920  Solved: 569[Submit][Status][Discuss] Description ...

  10. ubuntu系统克隆

    使用clonezilla,原文地址:http://www.linuxidc.com/Linux/2014-09/107117.htm 类似的一篇:http://storysky.blog.51cto. ...