Last night I tried to upgrade my Ubuntu OS and MySQL 5.7.15 was one of the changes. It seems upgrading is successfull because mysql is propely working, but installation proccess has stop working with this message:
This installation of MySQL is already upgraded to 5.7.15,
use --force if you still need to run mysql_upgrade
I can't cancel the installation proccess in reqular way and just have to kill it. So it may cause some problem and also for every other installation (in the future) it tries to do it again.
How to prevent this upgrade or solve it?
This solution solved my problem:
Back-up your database files with permissions:
Delete mysql files:
Remove MySQL completely via running:
Use of Synaptic is recommended.
Create these folders:
mysql setup didn't do it automatically and I don't know why.
Install MySQL again
I used
sudo apt install lamp-server^
instead to install other dependencies for PHP development.Stop MySQL:
Restore databases and files:
Restart MySQL:
An easy solution is to
sudo killall mysqld
while the apt-get operation is running.The apt operation just kept on running without any errors after that(!)
I managed to fix this without having to purge everything. It seems the problem is that the sys schema database was never created, so here's the solution:
Enjoy mysql_upgrade working again. I guess this probably was, an upgrading scripts mess-up.
If your root@
localhost
account has no password then there is a bug in the postinstall process as stated here (see particularly the last comment of the thread)TMP*
files in/var/lib/mysql-files
edit the file
/var/lib/dpkg/info/mysql-server-5.7.postinst
and comment (using #) the line 370 :echo "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'auth_socket';" >> "$initfile"
run again
sudo dpkg --configure -a
I had this issue too. Every time I started apt get and installed the process would hang after or during the DB update. None of the other solutions here worked.
In the end I purged
And followed the manual install from the instructions for mysql here
I then overwrote the data directory with my old data
and finally added a systemd service like this
/lib/systemd/system/mysql.service
Then ran
Then everything seemed to be working as before and mysql was not breaking system updates
The downside, of course, is that I'll need to do manual updates in the future.