mysql冷备份恢复无法启动_CentOS6环境下Mysql冷备份恢复后无法启动问题

【环境说明】

CentOS 6.8(默认开启了SELinux)使用YUM安装搭建的Mysql社区版;

【问题现象】

关闭Mysql服务;

删除当前数据目录/var/lib/mysql中的所有文件;

使用之前/var/lib/mysql目录的备份文件解压覆盖;

启动Mysql服务,启动失败;

查询Mysql日志文件/var/log/mysqld.log如下报错

2018-02-01T09:06:39.475244Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.

2018-02-01T09:06:39.475316Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.

2018-02-01T09:06:39.475321Z 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions

2018-02-01T09:06:39.475325Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error

2018-02-01T09:06:40.079659Z 0 [ERROR] Plugin 'InnoDB' init function returned error.

2018-02-01T09:06:40.079690Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2018-02-01T09:06:40.079695Z 0 [ERROR] Failed to initialize builtin plugins.

2018-02-01T09:06:40.079698Z 0 [ERROR] Aborting

【解决方案】

# chcon -Rt mysqld_db_t /var/lib/mysql

# chcon -Ru system_u /var/lib/mysql

# chown -R mysql:mysql /var/lib/mysql

# service mysqld start

启动正常

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值