Score:0

Problem installing mysql on Ubuntu 20.04

th flag

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
in flag
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
Exatoon27 avatar
th flag
@matigo Thank you
karel avatar
sa flag
Does this answer your question? [16.04 upgrade broke mysql-server](https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.