Bonjour, obtenez l'erreur suivante lors de l'installation de mysql
Sudo apt-get installe mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-Azure-cloud-tools-4.13.0-1012 linux-cloud-tools-4.13.0-1012-Azure
Use 'Sudo apt autoremove' to remove them.
The following additional packages will be installed:
mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/18.0 MB of archives.
After this operation, 160 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 ... 143619 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.22-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-common (5.7.22-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../mysql-client-core-5.7_5.7.22-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-client-core-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.22-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-client-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.22-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-server-core-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-common (5.7.22-0ubuntu0.16.04.1) ...
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-5.7.
(Reading database ... 143774 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.22-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.22-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-server (5.7.22-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Setting up mysql-client-core-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Setting up mysql-client-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Setting up mysql-server-core-5.7 (5.7.22-0ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
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)
insserv: warning: script 'ehcp_daemon.py' missing LSB tags and overrides
insserv: warning: script 'ehcp' missing LSB tags and overrides
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
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
Processing triggers for systemd (229-4ubuntu21.2) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for ureadahead (0.100.0-19) ...
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é
Sudo apt-get -f install
J'ai aussi essayé la solution dans this et this
Le statut des paquets mysql est dpkg -l | grep mysql
ii mysql-client-5.7 5.7.22-0ubuntu0.16.04.1 AMD64 MySQL database client binaries
ii mysql-client-core-5.7 5.7.22-0ubuntu0.16.04.1 AMD64 MySQL database core client binaries
ii mysql-common 5.7.22-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
iU mysql-server 5.7.22-0ubuntu0.16.04.1 all MySQL database server (metapackage depending on the latest version)
iF mysql-server-5.7 5.7.22-0ubuntu0.16.04.1 AMD64 MySQL database server binaries and system database setup
ii mysql-server-core-5.7 5.7.22-0ubuntu0.16.04.1 AMD64 MySQL database server binaries
ii php5.6-mysql 5.6.35-1+ubuntu16.04.1+deb.sury.org+1 AMD64 MySQL module for PHP
Bien que ces erreurs se produisent, je suis capable de me connecter à MySQL. Est-il possible de continuer avec ces erreurs? S'il vous plait, j'ai besoin de votre aide avec ceci.
J'ai eu le même problème.
Je l'ai résolu en purgeant la configuration.
mysqldump -u root -p --all-databases > ~/alldb.sql
Sudo apt purge "mysql-server-*"
Sudo apt install mysql-server
, vous devriez voir Running queries to upgrade MySQL server.
et il affichera toutes les tables de votre base de données.¹ Je ne sais pas pourquoi cela ne supprime pas les tables et les bases de données