This installation of MySQL has been upgraded to 5.7.40, if you still need to run mysql_upgrade, please use --force dpkg: Error while processing package mysql-server-5.7 (--configure): After the mysql-server-5.7 package is installed, the script subprocess returns an error exit status of 1 An error was encountered while processing: mysql-server-5.7 E: Child process /usr/bin/dpkg returns error code (1)
What should I do here?
I tried these commands but I still get the error:
sudo apt-get clean sudo apt-get clear mysql* sudo apt-get update sudo apt-get install -f sudo apt-get install mysql-server-5.7 sudo apt-get dist-upgrade
P粉9472963252024-01-30 00:51:25
Try something like this. This helped me:
sudo service mysql stop sudo apt-get --purge remove mysql* sudo rm -rf /etc/mysql/ Then I reinstalled it: sudo apt-get update sudo apt-get upgrade sudo apt-get install mariadb-server sudo service mysql start sudo mysql -u root -p secret sudo mysql -u root -p GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' IDENTIFIED BY ''; FLUSH PRIVILEGES;