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

前端 未结 10 1144
失恋的感觉
失恋的感觉 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:13

    Please note that since 10.1.10, MariaDB uses systemd to start the service. If you have tried MYSQLD_STARTUP_TIMEOUT and it has not worked, you are probably using this or a later version. The /etc/init.d/mysql script is no longer used, so MYSQLD_STARTUP_TIMEOUT has no effect.

    You need to find your mariadb.service file. In our case, it did not contain a timeout so the MariaDB default was being used. Just add:

    TimeoutStartSec = 0

    In the [Service] section, and it will never time out.

    It would be a good idea to create your own config file containing this so it doesn't get overwritten by later re-installs.

    On ubuntu 18.04, you will fine this file in

    /lib/systemd/system/mariadb.service

    Put your own file in

    /etc/systemd/system/mariadb.service.d

    Remember to run systemctl daemon-reload after adding the timeout somewhere (and maybe check /var/log/syslog to see if the reload was successful), otherwise your time out will be ignored.

提交回复
热议问题