Mysql won't start - ibdata1 corrupt? - operating system error number 13 - permissions issue

前端 未结 14 1676
粉色の甜心
粉色の甜心 2020-12-05 02:29

Server shutdown from power failure.
Mysql will not start now.
Disk is not full. Syslog is below

Oct 11 15:03:31 joe mysqld_safe[24757]: started
Oct 1         


        
14条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 03:12

    I had exactly the same problem on my CentOS box. After moving mysql data directory around I couldn't start the service anymore, even as I had copied the files with the same owner and permissions.

    I had a problem with the SELinux security context. If you run your CentOS stock it has good chance to be enabled and won't let do what you want with MySQL. To fix this :

    First compare the old dir and new dir using

    ls -Z /var/lib/mysql 
    

    and

    ls -Z /new/mysql/dir
    

    If you see any difference it's likely to be your problem. To modify this :

    chcon -R --type=mysql_db_t /new/mysql/dir
    

    The -R switch is for recursion. If you only need to change one file you can omit it. If your context is different than mine(maybe a different distro), use the one indicated by the output of the first (it should be the 3rd field of the SELinux stuff)

    ls -Z /var/lib/mysql 
    

提交回复
热议问题