maria db will not start

Discussion in 'ISPConfig 3 Priority Support' started by LinuxPete, Aug 1, 2019.

Tags:
  1. LinuxPete

    LinuxPete Member HowtoForge Supporter

    I tried starting Mariadb with
    this is the error I got:
    Job for mariadb.service failed because the control process exited with error code.
    See "systemctl status mariadb.service" and "journalctl -xe" for details.
    # systemctl status mariadb.service
    ‚óŹ mariadb.service - MariaDB 10.1.37 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Wed 2019-07-31 19:15:04 CDT; 48s ago
    Docs: man:mysqld(8)
    https://mariadb.com/kb/en/library/systemd/
    Process: 6760 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAIL
    Process: 6668 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -e
    Process: 6664 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 6662 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Main PID: 6760 (code=exited, status=1/FAILURE)
    Status: "MariaDB server is down"
    Jul 31 19:15:03 avalon systemd[1]: Starting MariaDB 10.1.37 database server...
    Jul 31 19:15:04 avalon mysqld[6760]: 2019-07-31 19:15:04 140428196752768 [Note] /usr/sbin/mysqld (mysqld 10.1.37-MariaDB-0+deb
    Jul 31 19:15:04 avalon systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
    Jul 31 19:15:04 avalon systemd[1]: Failed to start MariaDB 10.1.37 database server.
    Jul 31 19:15:04 avalon systemd[1]: mariadb.service: Unit entered failed state.
    Jul 31 19:15:04 avalon systemd[1]: mariadb.service: Failed with result 'exit-code'.

    When I looked for errors in the error log at /var/log/mysql/error.log ****** it was empty *****
    I tried
    /usr/sbin/mysqld
    2019-07-31 19:24:34 140295639166336 [Note] /usr/sbin/mysqld (mysqld 10.1.37-MariaDB-0+deb9u1) starting as process 7001 ...
    2019-07-31 19:24:34 140295639166336 [Warning] Can't create test file /var/lib/mysql/avalon.lower-test
    /usr/sbin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2 "No such file or directory")

    I created /var/lob/mysql and then got error messages in the error log:
    Here is one that stood out:
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.


    What are the perms of the /var/lib/mysql directory should it by root:adm?
    Thanks
    Ray
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The /var/lib/mysql directory is not empty when MariaDB is installed, it contains e.g. the 'mysql' database and some other files. Recreating the folder, even with correct permissions, will not help you. Either MariaDB has not been successfully installed or the directory was removed. Reinstall MariaDB to get a working basic database system back.
     
  3. LinuxPete

    LinuxPete Member HowtoForge Supporter

    Thanks for getting back, Till. This system has been working for several years. I recently ran updates but I did not check complete system functionality until the next day. That's when I noticed the problem.

    I'll look around my system, I'm curious as to how this could have happened. I only use the admin account (root) from the console.
    Thanks, I'll keep you updated.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, I assumed that it's a new install. If you have a backup of your server, then you should try to get the whole folder /var/lib/mysql/ back from the backup. The folder contains all your databases.
     
  5. LinuxPete

    LinuxPete Member HowtoForge Supporter

    OK. Looks like some how during a maintenance period I removed them. Thanks for the help Till
     

Share This Page