Mysql启动报错’./mysql-bin.index’ not found的问题
2019/10/10/17:37:11 阅读:1869 来源:谷歌SEO算法 标签:
Linus Torvalds
今天试着更改了mysql的数据存储目录,如何更改mysql的存储目录,但是启动mysql一直提示Starting MySQL. ERROR! The server quit without updating PID file (/data/mysql/11Z.pid)
于是乎去查看mysql的错误日志,cat /data/mysql/11Z.err:
- 13120409:09:15mysqld_safeStartingmysqlddaemonwithdatabasesfrom/data/mysql
- /usr/local/mysql/bin/mysqld:File'./mysql-bin.index'notfound(Errcode:13)
- 1312049:09:15[ERROR]Aborting
- 1312049:09:15[Note]/usr/local/mysql/bin/mysqld:Shutdowncomplete
- 13120409:09:15mysqld_safemysqldfrompidfile/data/mysql/11Z.pidended
- 13120409:09:22mysqld_safeStartingmysqlddaemonwithdatabasesfrom/data/mysql
- /usr/local/mysql/www.phpfensi.com/mysqld:File'./mysql-bin.index'notfound(Errcode:13)
- 1312049:09:22[ERROR]Aborting
- 1312049:09:22[Note]/usr/local/mysql/bin/mysqld:Shutdowncomplete
- 13120409:09:22mysqld_safemysqldfrompidfile/data/mysql/11Z.pidended
提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题,查看了数据库根目录的权限是700,所有者和用户组都是root,可能是上次转移数据库的时候不小心修改了文件夹的权限。
使用命令chown -R mysql.mysql /data/mysql/ 更改权限后,重新启动mysql,一切正常.
修改文件夹权限,代码如一:
- [root@XXXXmysql]#pwd
- /var/lib/mysql
- [root@XXXXmysql]#chown-Rmysql:mysqlbinlogs
- [root@XXXXmysql]#
- [root@XXXXmysql]#/etc/init.d/mysqlrestart
- MySQLmanagerorserverPIDfilecouldnotbefound![FAILED]
- StartingMySQL.[OK]
- [root@XXXXmysql]#
热门评论