Skip to main content

systemctl start mariadb error but mysql running

Comments

5 comments

  • cPanelMichael
    Hello @codepoet, The method you used to move the data directory is unsupported in MariaDB. There's a thread on this topic at: It notes to use a bind mount as a workaround instead of a symbolic link. Thank you.
    0
  • codepoet
    Hello @cPanelMichael Thank you. Actually I didn't even use the symlink or ebev a mount. By changing the datadir in the my.cnf all is good and running well. Actually I'm just trying to understand the other part about why on a cpanel server I have mariadb and when checking the status of the mariadb service it says inactive (dead) and if I run service mysql status I get mariadb running as a status
    0
  • cPanelMichael
    Hello @codepoet, Here's an example of output I see on a test system running MariaDB: systemctl status mariadb ? mariadb.service - MariaDB 10.2.19 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d ??migrated-from-my.cnf-settings.conf Active: active (running) since Wed 2018-11-21 12:01:32 CST; 20s ago
    If you're seeing "Inactive", then it's very likely related to the issued noted in my last response. If you're defining a location in /home as the data directory for MariaDB in the /etc/my.cnf file, then you must perform one of the following steps (from most-to-lease desirable): 1. Move the data directory back to the default location after increasing the size of the root filesystem or mounting a large enough filesystem under /var, /var/lib, or /var/lib/mysql, if necessary. 2. Remove any custom datadir option from /etc/my.cnf, remove any /var/lib/mysql symlink, and use a bind-mount from the non-default datadir location to /var/lib/mysql. 3. Use a drop-in configuration file to disable the systemd ProtectHome and ProtectSystem options for the MariaDB service (this is highly discouraged and should only be used as a last resort). EX # cat /etc/systemd/system/mariadb.service.d/disable-protect.conf [Service] ProtectHome=false ProtectSystem=false # systemctl daemon-reload # /scripts/restartsrv_mysql
    Thank you.
    0
  • codepoet
    Hello @cPanelMichael I have already done those manipulations. Thank you for your guidance. My only misunderstanding is how the database server is working if mariadb.service says inactive. I migrated from MySQL to mariadb when I installed whm/cpanel and I see mariadb when I login in ssh with the mysql command... Have an idea ?
    0
  • cPanelMichael
    My only misunderstanding is how the database server is working if mariadb.service says inactive. I migrated from MySQL to mariadb when I installed whm/cpanel and I see mariadb when I login in ssh with the mysql command...

    Hello @codepoet, It's normal for the mysql command to continue working after installing MariaDB. MariaDB is a drop-in replacement for MySQL, so commands such as "mysql" will continue to work. The system automatically detects and uses MariaDB in these situations.
    mariadb.service says inactive.

    You should not see an inactive status for MariaDB when running the systemctl status mariadb command. Could you open a
    0

Please sign in to leave a comment.