The new server, first installed on Ubuntu mariadb, and later due to a lot of permissions issues, decided to install MySQL, during the uninstallation process due to not uninstalled cleanly, resulting in a lot of problems in MySQL reload process.
reading Package lists ... Donebuilding dependency treereading state information ... Donemysql -server is already the newest version (5.7 . 21 -0ubuntu0. 16.04 . 1 " apt-get-f Install " to correct these:the following packages Have unmet dependencies:mysql -server:depends:mysql-server-5.7 But it isn't going to be installede:unmet dependencies. Try " apt-get-f install " with no packages (or specify a solution).
By reading the error message, it is mainly because of the dependency problem, the main idea is to rebuild the dependency, and then clean Uninstall, and finally reinstall.
First, update the system
sudo apt-get update
Then, fix the installation error, you will be prompted to enter the MySQL user name password
sudo Install
Then, retrieve the MySQL installation package and remove the retrieved dependency package, then delete the/var/lib/mysql, and finally reload MySQL.
Let me show you the solution I have retrieved:
We Excute The following commands to solve the above problem: 1 sudo grep MySQL 2 . Remove the packages shown above by executing the command sudo1> 3. delete/var/lib/MySQL 4install MySQL again. It should solve your problem.
The packages in the second step is as follows:
The last is to update the system and reload MySQL.
sudo apt-get updatesudo apt-get install Mysql-server mysql-client
Summarize:
The overall idea is to rebuild dependencies, clean uninstall, and update the installation. We hope to be inspired and helpful to the small partners who are overwhelmed with the same problems. Thank you.
Ubuntu Reload MySQL Error resolution