Upgrading to MySQL 5.7.15 crashes on Ubuntu 16.04
This solution solved my problem:
Back-up your database files with permissions:
sudo cp -avt /your/backup/directory /var/lib/mysql /etc/mysql/my.cnf
Delete mysql files:
sudo rm -rv /etc/mysql
Remove MySQL completely via running:
sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 mysql-client-5.7 mysql-client-core-5.7
Use of Synaptic is recommended.
Create these folders:
sudo mkdir -p /etc/mysql/conf.d
mysql setup didn't do it automatically and I don't know why.
Install MySQL again
sudo apt install mysql-server
I used
sudo apt install lamp-server^
instead to install other dependencies for PHP development.Stop MySQL:
sudo service mysql stop
Restore databases and files:
sudo cp -a /your/backup/directory/mysql /var/lib sudo cp /your/backup/directory/my.cnf /etc/mysql
Restart MySQL:
sudo service mysql start
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:
- Clone https://github.com/mysql/mysql-sys and cd into the cloned folder.
- In a terminal, run mysql -u root -p < ./sys_57.sql (or sys_56.sql, depending on your version)
Enjoy mysql_upgrade working again. I guess this probably was, an upgrading scripts mess-up.