thierryler
thierryler

Reputation: 199

mysql does not restart

I've tried to restart mysql 5.7 : service mysql restart

But it fails and i do not understand why :

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

And I dont see what's wrong in the logs :

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 Mon 2019-02-25 22:02:52 GMT; 1min 9s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 15467 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=127)
 Main PID: 28679 (code=exited, status=0/SUCCESS)

Feb 25 22:02:52 stretch systemd[1]: Starting MariaDB 10.1.37 database server...
Feb 25 22:02:52 stretch systemd[1]: mariadb.service: Control process exited, code=exited status=127
Feb 25 22:02:52 stretch systemd[1]: Failed to start MariaDB 10.1.37 database server.
Feb 25 22:02:52 stretch systemd[1]: mariadb.service: Unit entered failed state.
Feb 25 22:02:52 stretch systemd[1]: mariadb.service: Failed with result 'exit-code'.

Any help would be welcome...

I'm on Debian 9, with 1800Mo in ram free.

Here is what the journal says :

journalctl -xe

Feb 26 08:09:01 stretch CRON[16792]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb 26 08:09:01 stretch CRON[16793]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Feb 26 08:09:01 stretch CRON[16792]: pam_unix(cron:session): session closed for user root
Feb 26 08:17:01 stretch CRON[16794]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb 26 08:17:01 stretch CRON[16795]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb 26 08:17:01 stretch CRON[16794]: pam_unix(cron:session): session closed for user root
Feb 26 08:25:23 stretch systemd[1]: Starting MariaDB 10.1.37 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has begun starting up.
Feb 26 08:25:23 stretch systemd[1]: mariadb.service: Control process exited, code=exited status=127
Feb 26 08:25:23 stretch systemd[1]: Failed to start MariaDB 10.1.37 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
Feb 26 08:25:23 stretch systemd[1]: mariadb.service: Unit entered failed state.
Feb 26 08:25:23 stretch systemd[1]: mariadb.service: Failed with result 'exit-code'.

Upvotes: 2

Views: 2645

Answers (2)

haveyaseen
haveyaseen

Reputation: 196

I also got this error when upgrading to Debian Buster (from MariaDB 10.1 to 10.3). Running mysqld myself and mysql_upgrade both worked anyways. Try executing the following command to restart systemd on the fly. See also https://unix.stackexchange.com/a/419375.

systemctl daemon-reexec

If you don't do this, a reboot will probably fix this as well. Commenting out the ExecStartPre in /etc/systemd/system/mysql.service was not enough as the other ExecStartPre commands then failed instead (also with the exit code 127, i.e. "command not found").

Upvotes: 5

danblack
danblack

Reputation: 14646

Under Process: is the ExecStartPre returning with an error exist status

Based on error 127, I'd suspect that /usr/bin/install doesn't exist.

Upvotes: 0

Related Questions