J'ai essayé de désinstaller et de réinstaller MySQL sur Ubuntu 16.04, j'ai vu beaucoup de méthodes, mais je ne comprends pas pourquoi je reçois une erreur.
$ Sudo apt-get install mysql-server
mysql-server is already the newest version (5.7.17-0ubuntu0.16.04.2).
The following package was automatically installed and is no longer required:
snap-confine
Use 'Sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.04.2) ...
Renaming removed key_buffer and myisam-recover options (if present)
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 Mi 2017-04-26 12:15:04 EEST; 5ms ago
Process: 13693 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
apr 26 12:15:04 alex-X750JB systemd[1]: Failed to start MySQL Community Server.
apr 26 12:15:04 alex-X750JB systemd[1]: mysql.service: Unit entered failed state.
apr 26 12:15:04 alex-X750JB systemd[1]: mysql.service: Failed with result 'exit-code'.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 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-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
J'ai essayé ces étapes:
Sudo apt-get purge mysql*
Sudo apt-get autoremove
Sudo apt-get autoclean
Sudo apt-get dist-upgrade
Sudo apt-get install mysql-server
Tout va bien, jusqu'à ce que j'utilise Sudo apt-get install mysql-server
Si je lance systemctl status mysql.service
:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Mi 2017-04-26 13:30:19 EEST; 11min ago
Process: 17650 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
apr 26 13:30:18 alex-X750JB systemd[1]: Failed to start MySQL Community Server.
apr 26 13:30:18 alex-X750JB systemd[1]: mysql.service: Unit entered failed state.
apr 26 13:30:18 alex-X750JB systemd[1]: mysql.service: Failed with result 'exit-code'.
apr 26 13:30:19 alex-X750JB systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
apr 26 13:30:19 alex-X750JB systemd[1]: Stopped MySQL Community Server.
apr 26 13:30:19 alex-X750JB systemd[1]: mysql.service: Start request repeated too quickly.
apr 26 13:30:19 alex-X750JB systemd[1]: Failed to start MySQL Community Server.
J'ai suivi les instructions de ici et j'ai réussi à réinstaller mysql-server et cela a fonctionné.