0

What happens is that when executing the command "sudo apt-get install mysql-server" it throws me the following error:

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2021-12-28 16:30:45 CST; 6ms ago
    Process: 10525 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)

Dec 28 16:30:45 exatoon27-Inspiron-3558 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
Dec 28 16:30:45 exatoon27-Inspiron-3558 systemd[1]: Stopped MySQL Community Server.
Dec 28 16:30:45 exatoon27-Inspiron-3558 systemd[1]: Starting MySQL Community Server...
Dec 28 16:30:45 exatoon27-Inspiron-3558 mysql-systemd-start[10534]: MySQL system database not found in /var/lib/mysql. Please run mysqld --initialize.
Dec 28 16:30:45 exatoon27-Inspiron-3558 systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
Dec 28 16:30:45 exatoon27-Inspiron-3558 systemd[1]: mysql.service: Failed with result 'exit-code'.
Dec 28 16:30:45 exatoon27-Inspiron-3558 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)

It should be noted that I already tried the following in the order in which they are:

sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
sudo apt-get install mysql-server
Exatoon27
  • 13
  • 5
  • The message is saying that the core MySQL database definition files are missing. Have you run `sudo mysqld --initialize` to rebuild them? How many times has MySQL been installed/uninstalled on this system? Removing (or resetting) MySQL needs to be done in a very specific way, otherwise it cannot be cleanly reinstalled – matigo Dec 28 '21 at 22:55
  • Does this answer your question? [16.04 upgrade broke mysql-server](https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server) – karel Dec 29 '21 at 00:40

0 Answers0