SYSTEM INFORMATION | |
---|---|
OS type and version | Ubuntu Linux 20.04.5 |
Webmin version | 2.013 |
Virtualmin version | 7.5 |
Related packages | mysql-client-8.0 8.0.32-0buntu0.20.04.1 |
mysql-client-core-8.0 8.0.32-0buntu0.20.04.1 | |
mysql-common 5.8+1.0.5ubuntu2 | |
mysql-server-core-8.0 8.0.32-0buntu0.20.04.1 | |
php-mysql 7.4+75 | |
php7.4-mysql 7.4.3-4ubuntu2.17 |
Hello all
I have a VPS which had a clean ubuntu 20 + virtualmin install last year and has been running OK, doing the usual updates that show up in webmin by apt. The server hosts a dozen customer accounts (websites + email). The VPS is beefy (xeon octacore, 32G RAM, SSD), so no lack of resources.
Today there were a bunch of updates and suddenly I get an error, saying Mysql is not configured and wont start anymore.
Looking into the errors, I see that mysql has been updated to version 8 and I guess the previous version it had was 5.8, looking into what’s installed under the mysql name (pls see “related packages”). I am aware that ubuntu 20 supposedly ships with mysql 8, probably the image the hosting company has for vps had version 5.8
/var/log/mysql says
[Server] /usr/sbin/mysqld (mysqld 8.0.32-0buntu0.20.04.1) starting as process 16667
[ERROR] [MY-011011] [Server] Failed to find valid data directory.
[ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
[ERROR] [MY-010119] [Server] Aborting
systemctl status mysql.service says:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2023-01-25 10:27:26 WET; 16min ago
Process: 4357 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 4366 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Main PID: 4366 (code=exited, status=1/FAILURE)
Status: “Server shutdown complete”
systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
systemd[1]: Stopped MySQL Community Server.
systemd[1]: mysql.service: Start request repeated too quickly.
systemd[1]: mysql.service: Failed with result ‘exit-code’.
systemd[1]: Failed to start MySQL Community Server.
and /etc/mysql/my.cnf is empty (i.e: it’s a shortcut to mysql.cnf, which is all greyed out)
mysql databases are located in /var/lib/mysql/ (each under it’s on subdirectory)
Trying to install mysql via package update gives the following error:
Setting up mysql-server-8.0 (8.0.32-0buntu0.20.04.1) …
Renaming removed key_buffer and myisam-recover options (if present)
Specified filename /var/lib/mysql/ibdata1 does not exist.
mysqld will log errors to /var/log/mysql/error.log
2023-01-25T11:02:51.456936Z 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 Wed 2023-01-25 11:02:53 WET; 11ms ago
Process: 22988 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 23011 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Main PID: 23011 (code=exited, status=1/FAILURE)
Status: “Server shutdown complete”
dpkg: error processing package mysql-server-8.0 (–configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.9.1-1) …
Processing triggers for libc-bin (2.31-0ubuntu9.9) …
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
Tried some solutions found online, including here in the forums, like uninstalling and reinstalling mysql, trying to run virtualmin wizard (that halts on mysql), nothing worked
Maybe it’s just a question of editing some configuration files, but I don’t know which and what to put there. Also, I need some help to recreate the ibdata1 file that is missing.
Right now system is down and customers complaining. Any help is much appreciated.
Thanks in advance and best regards
Alex