This is a post with some technical stuff wrt MySQL 5.7 errors and capturing the steps to fix. Hopefully this will become a howto sometime!
We are facing MySQL 5.7 upgrade issues which is originally caused by a MariaDB installation attempt on the server. As we have important production data, trying to fix this rather than cleaning up.
Various errors and steps to fix them are documented here.
dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet. dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured
The following seems to be caused by an upgrade getting stuck in the middle.
/usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-server-5.7.postinst configure 27227 ? S 0:00 \_ /bin/bash /var/lib/dpkg/info/mysql-server-5.7.postinst configure 27432 ? Sl 0:02 \_ mysqld --user=mysql --init-file=/var/lib/mysql-files/tmp.0yE44m5S8o --socket=/tmp/tmp.obEIHSINpC/mysqld.sock --pid-file=/t
Once the above processes are killed with kill -9, apt -f install is issued
root@phabricator:~# apt -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present)
The apt or dpkg configure is getting stuck while executing
This can be debugged with -x option passed to the shell by editing the first line of
This gives you an error
+ mysql_upgrade --defaults-file=/etc/mysql/debian.cnf mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server Upgrade process encountered error and will not continue.
So, the fix seems to be, edit and give the root password in `/etc/mysql/debian.cnf'
and yes, It works!
don't forget to remove the root password once done. Hope tihs helps someone.