Why does /etc/mysql/debian-start give me this error when starting MariaDB on Linux Mint?

Viewed 704

I am setting up multiple instances of MariaDB on Linux Mint 20.2. I have managed to get the first one set up, and it seems basically OK (I can connect to a database, and by querying the MariaDB variables, can verify that the socket, port etc. match what I put in the configuration file). However, I am getting a confusing error, not from the server process itself, but from the associated systemd script. This is what happens when I start the service and then check the status :

root@TMG-Toshiba:/var/local/mysql/toot# systemctl status mariadb@toot
● mariadb@toot.service - MariaDB 10.3.32 database server (multi-instance toot)
     Loaded: loaded (/lib/systemd/system/mariadb@.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-12-07 18:35:11 GMT; 2s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 7776 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 7781 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITIONtoot (code=exited, status=0/SUCCESS)
    Process: 7790 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery --defaults-file=/etc/mysql>
    Process: 7881 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITIONtoot (code=exited, status=0/SUCCESS)
    Process: 7883 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 7850 (mysqld)
     Status: "Taking your SQL requests now..."
      Tasks: 30 (limit: 4137)
     Memory: 85.9M
     CGroup: /system.slice/system-mariadb.slice/mariadb@toot.service
             └─7850 /usr/sbin/mysqld --defaults-file=/etc/mysql/conf.d/mytoot.cnf

Dec 07 18:35:11 TMG-Toshiba systemd[1]: Starting MariaDB 10.3.32 database server (multi-instance toot)...
Dec 07 18:35:11 TMG-Toshiba mysqld[7850]: 2021-12-07 18:35:11 0 [Note] /usr/sbin/mysqld (mysqld 10.3.32-MariaDB-0ubuntu0.20.04.1) starting as process 7850 ...
Dec 07 18:35:11 TMG-Toshiba systemd[1]: Started MariaDB 10.3.32 database server (multi-instance toot).
Dec 07 18:35:12 TMG-Toshiba /etc/mysql/debian-start[7888]: Looking for 'mysql' as: /usr/bin/mysql
Dec 07 18:35:12 TMG-Toshiba /etc/mysql/debian-start[7888]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Dec 07 18:35:12 TMG-Toshiba /etc/mysql/debian-start[7888]: Version check failed. Got the following error when calling the 'mysql' command line client
Dec 07 18:35:12 TMG-Toshiba /etc/mysql/debian-start[7888]: ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (115)
Dec 07 18:35:12 TMG-Toshiba /etc/mysql/debian-start[7888]: FATAL ERROR: Upgrade failed
Dec 07 18:35:12 TMG-Toshiba /etc/mysql/debian-start[7897]: Checking for insecure root accounts.
Dec 07 18:35:12 TMG-Toshiba debian-start[7900]: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Could it be that it is complaining about not being able to connect through a socket because I have specified "protocol = tcp" in the "client.cnf" section (I did this so I could just enter "mysql -P 3307 ..., mysql -P 3308" etc, instead of having to type in the socket path)? But in any case, should it be running that script anyway? The "debian-start" script is called by mariadb@.service, but if you look at the "debian-start" script itself, it actually contains this line:

 NOTE: This file is read only by the traditional SysV init script, not systemd.

So should I just remove from mariadb@.service that call to debian-start?

0 Answers
Related