MySQL stopped working after Software Update

Hi,

I have just run a software update through Virtualmin and MySQL has stopped working.

Anyone any ideas how I fix this? Thanks in advance.

When I try and start the server through Virtualmin, I receive the following error:

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

Result of systemctl status mysql.service:

Failed to connect to bus: No such file or directory

Result of journalctl -xe

-- The job identifier is 24300.
Feb 22 13:33:47 dev.test multipathd[670]: sda: add missing path
Feb 22 13:33:47 dev.test multipathd[670]: sda: failed to get udev uid: Invalid argument
Feb 22 13:33:47 dev.test multipathd[670]: sda: failed to get sysfs uid: Invalid argument
Feb 22 13:33:47 dev.test multipathd[670]: sda: failed to get sgio uid: No such file or directory
Feb 22 13:33:51 dev.test systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit mysql.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Feb 22 13:33:51 dev.test systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
Feb 22 13:33:51 dev.test systemd[1]: Failed to start MySQL Community Server.
-- Subject: A start job for unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit mysql.service has finished with a failure.
-- 
-- The job identifier is 24300 and the job result is failed.
Feb 22 13:33:52 dev.test systemd[1]: mysql.service: Scheduled restart job, restart counter is at 28.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Feb 22 13:33:52 dev.test systemd[1]: Stopped MySQL Community Server.
-- Subject: A stop job for unit mysql.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit mysql.service has finished.
-- 
-- The job identifier is 24376 and the job result is done.
Feb 22 13:33:52 dev.test systemd[1]: Starting MySQL Community Server...
-- Subject: A start job for unit mysql.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit mysql.service has begun execution.
-- 
-- The job identifier is 24376.
Feb 22 13:33:52 dev.test multipathd[670]: sda: add missing path
Feb 22 13:33:52 dev.test multipathd[670]: sda: failed to get udev uid: Invalid argument
Feb 22 13:33:52 dev.test multipathd[670]: sda: failed to get sysfs uid: Invalid argument
Feb 22 13:33:52 dev.test multipathd[670]: sda: failed to get sgio uid: No such file or directory
lines 3275-3328/3328 (END)

When I run sudo apt-get upgrade:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-8.0 (8.0.23-0ubuntu0.20.04.1) ...
mysqld will log errors to /var/log/mysql/error.log
2021-02-22T13:36:10.333821Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2021-02-22 13:36:19 GMT; 19ms ago
    Process: 37534 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 37552 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
   Main PID: 37552 (code=exited, status=1/FAILURE)
     Status: "Server upgrade complete"
      Error: 2 (No such file or directory)

Feb 22 13:36:19 dev.test systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 22 13:36:19 dev.test systemd[1]: Failed to start MySQL Community Server.
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here are the last lines from /var/log/mysql/error.log

2021-02-22T13:44:46.598413Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.

2021-02-22T13:44:46.598752Z 0 [ERROR] [MY-010119] [Server] Aborting

2021-02-22T13:44:48.131649Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23-0ubuntu0.20.04.1) (Ubuntu).

2021-02-22T13:44:48.639093Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23-0ubuntu0.20.04.1) starting as process 42419

2021-02-22T13:44:48.644180Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2021-02-22T13:44:50.889134Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2021-02-22T13:44:51.481917Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '0.0.0.0' port: 33060, socket: /var/run/mysqld/mysqlx.sock

2021-02-22T13:44:51.507821Z 4 [System] [MY-013381] [Server] Server upgrade from '80022' to '80023' started.

2021-02-22T13:44:56.171145Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. -- -- T>

2021-02-22T13:44:56.173986Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.

2021-02-22T13:44:56.174408Z 0 [ERROR] [MY-010119] [Server] Aborting

2021-02-22T13:44:57.673885Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23-0ubuntu0.20.04.1) (Ubuntu).

2021-02-22T13:44:58.117367Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23-0ubuntu0.20.04.1) starting as process 42473

2021-02-22T13:44:58.122278Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2021-02-22T13:45:00.255817Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2021-02-22T13:45:00.811477Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '0.0.0.0' port: 33060, socket: /var/run/mysqld/mysqlx.sock

2021-02-22T13:45:00.837147Z 4 [System] [MY-013381] [Server] Server upgrade from '80022' to '80023' started.

2021-02-22T13:45:06.553721Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. -- -- T>

2021-02-22T13:45:06.556080Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.

2021-02-22T13:45:06.556569Z 0 [ERROR] [MY-010119] [Server] Aborting

2021-02-22T13:45:08.020588Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23-0ubuntu0.20.04.1) (Ubuntu).

2021-02-22T13:45:08.605022Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23-0ubuntu0.20.04.1) starting as process 42584

2021-02-22T13:45:08.610162Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2021-02-22T13:45:11.268962Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

Operating system: Ubuntu 20.04.1
OS version: 20.04.1

I managed to fix the problem by running the following:

sudo apt-get clean
sudo apt-get purge mysql*
sudo apt-get update
sudo apt-get install -f
sudo apt-get install mysql-server-8.0
sudo apt-get dist-upgrade

Hope this helps anyone who comes across the same problem.

I think the problem was a config issue which was listed close to the beginning and since your purged mysql, it also removed config files and created them from scratch with the new installation.
But as long as it works now. :slight_smile:

1 Like

I’m not sure what it was. All I did was run the package updates from the Virtualmin dashboard and it broke.

If you use 3rd party repos, then it is possible that that might have caused the issue.
Not that it matters right now since its resolved. :slight_smile:
We won’t know for sure without proper details and taking a deeper look into it. I would guess if such an issue appears again, that you should then take a proper look at it. Otherwise just “ignore” it for now.