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

前端 未结 14 1733
粉色の甜心
粉色の甜心 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 02:59

    In short, (especially on RHEL/CentOS/Fedora) try

    getenforce
    

    if it replies with Enforcing you have SELinux up and running. Temporarily deactivate it with setenforce 0 and see if MariaDB starts now! Rather common, especially on RHEL/CentOS/Fedora.

    There's more about this further down, as well as in this official article.

    In general

    There are more things in a UNIX environment that might prevent file access, than just user access rights.

    • Security modules like SELinux (see above) or AppArmor (as Dan mentioned) could disallow it
    • Access Control Lists (ACL) could be specifically set, for the required files/directories
    • Any of the parent folders could be owned by another user, and have no x (="dir access") set for others

    Additionally there could be other unexpected factors, like ...

    • The mysql datadir being set to a place, where mysql doesn't have permissions (see /etc/my.cnf)
    • Mysql could (strangely) be running as a different user, or the file could be simply owned by someone else

    Just to mention a view things off the top of my head (feel free to edit/add to this answer btw).

    In the case, SELinux is "the problem"

    For a permanent solution, you could try to restore the appropriate security context, ...

    restorecon -R /var/lib/mysql/
    

    ... or just deactivate SELinux (but think about this one a little bit before doing so), by editing the config (typically in /etc/selinux/config) and setting SELINUX=disabled as suggested in following article.

    • Here the official help page from mariadb.com: What to do if MariaDB doesn't start
    • And here something from redhat.com: MariaDB Changing Database Location

    Obviously those are applicable to MySQL just the same way.

提交回复
热议问题