ITPub博客

首页 > 数据库 > MySQL > File './mysql-bin.index' not found (Errcode: 13)

File './mysql-bin.index' not found (Errcode: 13)

原创 MySQL 作者:goolen 时间:2014-08-13 16:28:32 0 删除 编辑
今天做一个mysql的备机,拷贝数据的过程出现了一点点权限问题,记录一下

数据copy完成之后启动备库
[root@localhost data]# /etc/init.d/mysql start
Starting MySQL (Percona Server).The server quit without upd[FAILED]D file (/tol/mysql/data/localhost.localdomain.pid).

查看错误日志
[root@localhost data]# cat localhost.localdomain.err 
140813 15:54:58 mysqld_safe Starting mysqld daemon with databases from /tol/mysql/data
140813 15:54:58 [Note] Flashcache bypass: disabled
140813 15:54:58 [Note] Flashcache setup error is : ioctl failed

/tol/mysql/home/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
140813 15:54:58 [ERROR] Aborting

140813 15:54:58 [Note] /tol/mysql/home/bin/mysqld: Shutdown complete

140813 15:54:58 mysqld_safe mysqld from pid file /tol/mysql/data/localhost.localdomain.pid ended

mysql-bin.index文件存在,首先想到的就是权限的问题,查看果然是拷贝的过程中权限变了

[root@localhost data]# chown mysql:mysql ./*

[root@localhost data]# /etc/init.d/mysql start       
Starting MySQL (Percona Server)...The server quit without u[FAILED]PID file (/tol/mysql/data/localhost.localdomain.pid).

启动还是报错,报错如下:
[root@localhost data]# tail -20 localhost.localdomain.err 
140813 15:58:20 [Note] Flashcache bypass: disabled
140813 15:58:20 [Note] Flashcache setup error is : ioctl failed

/tol/mysql/home/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
140813 15:58:20 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
140813 15:58:20 InnoDB: The InnoDB memory heap is disabled
140813 15:58:20 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140813 15:58:20 InnoDB: Compressed tables use zlib 1.2.3
140813 15:58:20 InnoDB: Using Linux native AIO
140813 15:58:20 InnoDB: Initializing buffer pool, size = 1.0G
140813 15:58:20 InnoDB: Completed initialization of buffer pool
140813 15:58:20 InnoDB: highest supported file format is Barracuda.
140813 15:58:21  InnoDB: Waiting for the background threads to start
140813 15:58:22 Percona XtraDB (http://www.percona.com) 1.1.8-20.1 started; log sequence number 51744413276
140813 15:58:22 [Note] Recovering after a crash using mysql-bin
140813 15:58:22 [Note] Starting crash recovery...
140813 15:58:22 [Note] Crash recovery finished.
140813 15:58:22 [ERROR] /tol/mysql/home/bin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
140813 15:58:22 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
140813 15:58:22 mysqld_safe mysqld from pid file /tol/mysql/data/localhost.localdomain.pid ended

[root@localhost data]# ls mysql/plugin.frm -l
-rw-rw---- 1 root root 8586 Jun 16 13:23 mysql/plugin.frm

这个是因为上面更改权限的命令少加了-R参数,对二级目录下的文件权限没有改所导致,重新改一下权限,启动成功
[root@localhost data]# chown mysql:mysql mysql/*
[root@localhost data]# /etc/init.d/mysql start            
Starting MySQL (Percona Server)..                          [  OK  ]


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23249684/viewspace-1250656/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-10-20

  • 博文量
    121
  • 访问量
    731660