No puedo instalar mysql-server en Ubuntu 20.04.1 debido a varios errores

No puedo instalar mysql-server en Ubuntu 20.04.1 debido a varios errores

Hoy intenté instalar mysql-server(8.0) (sudo apt-get install mysql-server) en mi servidor ubuntu (20.04.1), pero encontré algunos problemas. Consulte el siguiente resultado para obtener más detalles:

The following NEW packages will be installed:
  mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server mysql-server-8.0 mysql-server-core-8.0
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.9 MB of archives.
After this operation, 189 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 110650 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../mysql-client-core-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../mysql-server-core-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 110850 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb ...
Unpacking mysql-server-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_8.0.21-0ubuntu0.20.04.4_all.deb ...
Unpacking mysql-server (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-client-core-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-server-core-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-client-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-server-8.0 (8.0.21-0ubuntu0.20.04.4) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
2020-08-16T09:45:14.387556Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
2020-08-16T09:45:14.394864Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Job for mysql.service failed because a fatal signal was delivered to the control process.
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: signal) since Sun 2020-08-16 09:45:20 UTC; 54ms ago
    Process: 48919 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 48937 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 48937 (code=killed, signal=KILL)
     Status: "Server startup in progress"

Aug 16 09:45:20 schmischma systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Aug 16 09:45:20 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
Aug 16 09:45:20 schmischma 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
Processing triggers for systemd (245.4-4ubuntu3.2) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

El registro de errores:

2020-08-16T11:29:32.708988Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 57698
2020-08-16T11:29:32.841068Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:39.082428Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 57831
2020-08-16T11:29:39.198886Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:42.232021Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 57886
2020-08-16T11:29:42.326165Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:44.030521Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58081
2020-08-16T11:29:44.113611Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:46.115552Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58291
2020-08-16T11:29:46.224423Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:47.945913Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58533
2020-08-16T11:29:48.277034Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:50.489209Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58594
2020-08-16T11:29:50.687419Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:52.459105Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58619
2020-08-16T11:29:52.620454Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:54.648353Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58641
2020-08-16T11:29:54.889784Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:29:56.663819Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58664
2020-08-16T11:29:56.808627Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:30:00.826807Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-08-16T11:31:20.324596Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58716
2020-08-16T11:31:20.467068Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:32:05.665260Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58758
2020-08-16T11:32:05.760406Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:32:07.370778Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58783
2020-08-16T11:32:07.420856Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:32:08.838413Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58805
2020-08-16T11:32:08.913356Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:32:10.301126Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58827
2020-08-16T11:32:10.346626Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-08-16T11:32:11.805196Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21-0ubuntu0.20.04.4) starting as process 58849
2020-08-16T11:32:11.861447Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

Salida del estado systemctl mysql.service:

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Sun 2020-08-16 11:44:19 UTC; 1s ago
    Process: 59020 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 59028 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 59028 (code=killed, signal=KILL)
     Status: "Server startup in progress"

Aug 16 11:44:19 schmischma systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Aug 16 11:44:19 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
Aug 16 11:44:19 schmischma systemd[1]: Failed to start MySQL Community Server.
Aug 16 11:44:19 schmischma systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Aug 16 11:44:19 schmischma systemd[1]: Stopped MySQL Community Server.
Aug 16 11:44:19 schmischma systemd[1]: mysql.service: Start request repeated too quickly.
Aug 16 11:44:19 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
Aug 16 11:44:19 schmischma systemd[1]: Failed to start MySQL Community Server.

salida de journalctl -xe:

-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit mysql.service has finished.
-- 
-- The job identifier is 21672 and the job result is done.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Start request repeated too quickly.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'signal'.
Aug 16 11:32:12 schmischma 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 21672 and the job result is failed.
Aug 16 11:34:56 schmischma PackageKit[57444]: daemon quit
Aug 16 11:34:56 schmischma systemd[1]: packagekit.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit packagekit.service has successfully entered the 'dead' state.
Aug 16 11:37:34 schmischma sshd[58872]: Accepted publickey for user from 185.236.147.245 port 52056 ssh2: RSA SHA256:ai/G0MIeL/RexEImoaCr7lLnBZE65qdgFhcyLD4389c
Aug 16 11:37:38 schmischma sudo[58878]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Aug 16 11:37:42 schmischma sudo[58878]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Aug 16 11:37:42 schmischma sudo[58878]:     user : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/su
Aug 16 11:37:42 schmischma sudo[58878]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Aug 16 11:37:42 schmischma su[58879]: (to root) root on pts/3
Aug 16 11:37:42 schmischma su[58879]: pam_unix(su:session): session opened for user root by user(uid=0)
Aug 16 11:37:42 schmischma systemd-logind[617]: New session c15 of user root.
-- Subject: A new session c15 has been created for user root
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
-- 
-- A new session with the ID c15 has been created for the user root.
-- 
-- The leading process of the session is 58879.
Aug 16 11:37:42 schmischma systemd[1]: Started Session c15 of user root.
-- Subject: A start job for unit session-c15.scope has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit session-c15.scope has finished successfully.
-- 
-- The job identifier is 21740.
Aug 16 11:38:06 schmischma sudo[58898]:     root : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/apt purge mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-core-8.0
Aug 16 11:38:06 schmischma sudo[58898]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Aug 16 11:38:47 schmischma sudo[58898]: pam_unix(sudo:session): session closed for user root
Aug 16 11:38:50 schmischma sudo[58902]:     root : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/apt purge mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-core-8.0

root@schmischma:/home/user# nano /var/log/mysql/error.log
root@schmischma:/home/user# systemctl status mysql.service
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Sun 2020-08-16 11:32:12 UTC; 8min ago
    Process: 58841 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 58849 ExecStart=/usr/sbin/mysqld (code=killed, signal=KILL)
   Main PID: 58849 (code=killed, signal=KILL)
     Status: "Server startup in progress"

Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
Aug 16 11:32:12 schmischma systemd[1]: Failed to start MySQL Community Server.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Scheduled restart job, restart counter is at 15.
Aug 16 11:32:12 schmischma systemd[1]: Stopped MySQL Community Server.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Start request repeated too quickly.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
Aug 16 11:32:12 schmischma systemd[1]: Failed to start MySQL Community Server.
root@schmischma:/home/user# journalctl -xe
-- A stop job for unit mysql.service has finished.
-- 
-- The job identifier is 21672 and the job result is done.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Start request repeated too quickly.
Aug 16 11:32:12 schmischma systemd[1]: mysql.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mysql.service has entered the 'failed' state with result 'signal'.
Aug 16 11:32:12 schmischma 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 21672 and the job result is failed.
Aug 16 11:34:56 schmischma PackageKit[57444]: daemon quit
Aug 16 11:34:56 schmischma systemd[1]: packagekit.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit packagekit.service has successfully entered the 'dead' state.
Aug 16 11:37:34 schmischma sshd[58872]: Accepted publickey for user from 185.236.147.245 port 52056 ssh2: RSA SHA256:ai/G0MIeL/RexEImoaCr7lLnBZE65qdgFhcyLD4389c
Aug 16 11:37:38 schmischma sudo[58878]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Aug 16 11:37:42 schmischma sudo[58878]: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory
Aug 16 11:37:42 schmischma sudo[58878]:     user : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/su
Aug 16 11:37:42 schmischma sudo[58878]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Aug 16 11:37:42 schmischma su[58879]: (to root) root on pts/3
Aug 16 11:37:42 schmischma su[58879]: pam_unix(su:session): session opened for user root by user(uid=0)
Aug 16 11:37:42 schmischma systemd-logind[617]: New session c15 of user root.
-- Subject: A new session c15 has been created for user root
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
-- 
-- A new session with the ID c15 has been created for the user root.
-- 
-- The leading process of the session is 58879.
Aug 16 11:37:42 schmischma systemd[1]: Started Session c15 of user root.
-- Subject: A start job for unit session-c15.scope has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit session-c15.scope has finished successfully.
-- 
-- The job identifier is 21740.
Aug 16 11:38:06 schmischma sudo[58898]:     root : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/apt purge mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-core-8.0
Aug 16 11:38:06 schmischma sudo[58898]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Aug 16 11:38:47 schmischma sudo[58898]: pam_unix(sudo:session): session closed for user root
Aug 16 11:38:50 schmischma sudo[58902]:     root : TTY=pts/3 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/apt purge mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-core-8.0
Aug 16 11:38:50 schmischma sudo[58902]: pam_unix(sudo:session): session opened for user root by user(uid=0)
Aug 16 11:38:54 schmischma sudo[58902]: pam_unix(sudo:session): session closed for user root

Ya intenté purgar y reinstalar el servidor mysql, pero no funcionó. También investigué si la gente ya había hecho esta pregunta o si hay algo en la documentación de MySQL, pero no tuve éxito. También intenté desactivar el firewall (ufw), pero tampoco funcionó.

Realmente aprecio cualquier ayuda.

Respuesta1

Verifique los modos sql en my.cnf. Mi configuración incluía un modo SQL que ya no era válido (NO_AUTO_CREATE_USER) y provocó que la actualización de Ubuntu 20.04 fallara sin terminar...

vi /etc/mysql/my.cnf

hizo el siguiente cambio

[mysqld] 
###sql_mode = "ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 
sql_mode = "ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

guarde y vuelva a intentar instalar...

Explicar exactamente por qué este modo sql no es válido en 20.04 es algo para Google... HTH

Respuesta2

Esto podría estar sucediendo si instaló Mysql anteriormente y no se ha eliminado por completo de su sistema. O existe la posibilidad de que su proceso no encuentre el archivo requerido para ejecutar mysql. intenta eliminar mysql por completo
sudo killall mysqld

sudo apt-get remove mysql

sudo rm -rf /etc/mysql

sudo reboot

luego intenta instalar mysql nuevamente

información relacionada