This installation of MySQL is already upgraded to 5.7.15, use --force if you still need to run mysql_upgrade

Комментарии ()

 

This solution solved my problem:

  1. Back-up your database files with permissions:

    sudo cp -avt /your/backup/directory /var/lib/mysql /etc/mysql/my.cnf
    
  2. Delete mysql files:

    sudo rm -rv /etc/mysql 
    
  3. 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.

  4. Create these folders:

    sudo mkdir -p /etc/mysql/conf.d
    

    mysql setup didn't do it automatically and I don't know why.

  5. Install MySQL again

    sudo apt install mysql-server
    

    I used sudo apt install lamp-server^ instead to install other dependencies for PHP development.

  6. Stop MySQL:

    sudo service mysql stop 
    
  7. Restore databases and files:

    sudo cp -a /your/backup/directory/mysql /var/lib   
    sudo cp /your/backup/directory/my.cnf /etc/mysql 
    
  8. Restart MySQL:

    sudo service mysql start 
    

Webit.in.ua 2013