Jenifer
Jenifer

Reputation: 75

systemd[1]: Failed to start MySQL Community Server while installing mysql-server

When I try to reinstall mysql it gives me the following error:

sudo apt-get install mysql-server
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
mysql-server ya está en su versión más reciente (8.0.19-1debian10).
Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios.
  galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl
  libdbd-mysql-perl libdbi-perl libfcgi-perl libhtml-template-perl
  libreadline5 libterm-readkey-perl rsync socat
Utilice «sudo apt autoremove» para eliminarlos.
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 179 no actualizados.
2 no instalados del todo o eliminados.
Se utilizarán 0 B de espacio de disco adicional después de esta operación.
¿Desea continuar? [S/n] s
Configurando mysql-community-server (8.0.19-1debian10) ...
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
Failed to get unit file state for mysql.service: Link has been severed
mysql.service is a disabled or a static unit, not starting it.
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; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-03-10 12:00:58 -03; 15ms ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 7906 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
  Process: 7941 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
 Main PID: 7941 (code=exited, status=1/FAILURE)
   Status: "Data Dictionary upgrade from MySQL 5.7 in progress"

mar 10 12:00:56 azeroth systemd[1]: Starting MySQL Community Server...
mar 10 12:00:58 azeroth systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
mar 10 12:00:58 azeroth systemd[1]: mysql.service: Failed with result 'exit-code'.
mar 10 12:00:58 azeroth systemd[1]: Failed to start MySQL Community Server.
dpkg: error al procesar el paquete mysql-community-server (--configure):
 el subproceso instalado paquete mysql-community-server script post-installation devolvió el código de salida de error 1
dpkg: problemas de dependencias impiden la configuración de mysql-server:
 mysql-server depende de mysql-community-server (= 8.0.19-1debian10); sin embargo:
 El paquete `mysql-community-server' no está configurado todavía.

dpkg: error al procesar el paquete mysql-server (--configure):
 problemas de dependencias - se deja sin configurar
Se encontraron errores al procesar:
 mysql-community-server
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

All I know is that it has to do with the smysql-community, but nothing else. I've already tried all listed here: https://askubuntu.com/questions/1008298/cant-start-mysql-server-database-corruption But nothing worked.

Also: journalctl -xe gives:

-- Support: https://www.debian.org/support
-- 
-- A start job for unit mysql.service has begun execution.
-- 
-- The job identifier is 2279.
mar 10 17:39:49 azeroth systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit mysql.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
mar 10 17:39:49 azeroth systemd[1]: mysql.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'exit-code'.
mar 10 17:39:49 azeroth systemd[1]: Failed to start MySQL Community Server.
-- Subject: A start job for unit mysql.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit mysql.service has finished with a failure.
-- 
-- The job identifier is 2279 and the job result is failed.
mar 10 17:39:49 azeroth sudo[2743]: pam_unix(sudo:session): session closed for user root
mar 10 17:41:51 azeroth sudo[2805]:  jenifer : TTY=pts/0 ; PWD=/home/jenifer ; USER=root ; COMMAND=/usr/bin/journalctl -xe
mar 10 17:41:51 azeroth sudo[2805]: pam_unix(sudo:session): session opened for user root by (uid=0)

I've already tried to remove mysql-server and reinstall it with apt-get, but it gives the same error. If somebody can help me I will appreciate it very much.

Upvotes: 3

Views: 8807

Answers (1)

Feriman
Feriman

Reputation: 627

You can solve this part:

[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.
[mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.

by editing mysql.conf file and replace

/var/run/mysqld

to

/run/mysqld

Upvotes: 1

Related Questions