mysql service fails to start/hangs up - timeout (Ubuntu, MariaDB)

前端 未结 10 1047
失恋的感觉
失恋的感觉 2020-12-08 00:46

I set up my first Ubuntu Server with Ubuntu 16.04, nginx, php7.0, MariaDB, nextcloud and external DynDNS using this tutorial here: Install Nextcloud 9 on Ubuntu 16.04

相关标签:
10条回答
  • 2020-12-08 01:24

    FYI:

    In my case neither the solution of Vincent or Lw Bi worked exactly, I needed some further actions.

    Disabling the profile through placing a link in /etc/apparmor.d/disable/ simply didn't work, I don't know why.

    On the other hand, setting MySQL to complain mode didn't work either immediately.

    :~$ sudo aa-complain /usr/sbin/mysqld
    

    Setting /usr/sbin/mysqld to complain mode.

    ERROR: /etc/apparmor.d/usr.sbin.mysqld contains no profile
    

    I needed to add the lines:

    /usr/sbin/mysqld {
    }
    

    to /etc/apparmor.d/usr.sbin.mysqld, and then I could set it to complain mode successfully.

    0 讨论(0)
  • 2020-12-08 01:26

    This last option worked for me (from quazgar). I have Ubuntu 18.10 installed with MariaDB 10.3.13:

    $ echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld
    $ apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
    $ systemctl restart mariadb
    

    I had to use "sudo su" for it to work though.

    0 讨论(0)
  • 2020-12-08 01:28

    Run the following commands:

    sudo dpkg --configure -a
    sudo service mysql start
    
    0 讨论(0)
  • 2020-12-08 01:29

    In case you are bitten by this bug, the solution is given as a suggestion in the bug report:

    1. echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld
    2. apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
    3. systemctl restart mariadb

    Background

    If you previously had MySQL installed, it activated an AppArmor profile which is incompatible with MariaDB. apt-get remove --purge only removes the profile, but does not deactivate/unload it. Only manually unloading it lets MariaDB work unhindered by AppArmor.

    0 讨论(0)
提交回复
热议问题