@Robie, I am using sudo -i for package upgrades.
Typing:
sudo -i
cd ~
ls -al
I do not see a .my.cnf file.
So I do not have something to rename.
I solved my problem by temporarily removing the password for the mysql root@localhost account. mysql_upgrade worked, although it expired the user accounts I was working with.
Trying to reproduce the issue again, I uninstalled and then reinstalled mysql-server (with mysql-server-5.7 & mysql-server-core-5.7) as root. It failed again:
Setting up mysql-server-5.7 (5.7.11-0ubuntu5) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server
then I tried as my normal user:
sudo apt-get -f install
Result:
Setting up mysql-server-5.7 (5.7.11-0ubuntu5) ...
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 it looks like it tried root@localhost again.
@Lars, the debian.cnf looks like this:
root@aspire-v3-771:/etc/mysql# cat debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = root
password =
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password =
socket = /var/run/mysqld/mysqld.sock
I guess Postinst did not try to log in with debian-sys-maint and no password.
@Robie, I am using sudo -i for package upgrades.
Typing:
sudo -i
cd ~
ls -al
I do not see a .my.cnf file.
So I do not have something to rename.
I solved my problem by temporarily removing the password for the mysql root@localhost account. mysql_upgrade worked, although it expired the user accounts I was working with.
Trying to reproduce the issue again, I uninstalled and then reinstalled mysql-server (with mysql-server-5.7 & mysql-server- core-5. 7) as root. It failed again:
Setting up mysql-server-5.7 (5.7.11-0ubuntu5) ... alternatives: using /etc/mysql/ mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
update-
mysql_upgrade: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) while connecting to the MySQL server
then I tried as my normal user:
sudo apt-get -f install
Result:
Setting up mysql-server-5.7 (5.7.11-0ubuntu5) ...
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 it looks like it tried root@localhost again.
@Lars, the debian.cnf looks like this:
root@aspire- v3-771: /etc/mysql# cat debian.cnf mysqld/ mysqld. sock mysqld/ mysqld. sock
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = root
password =
socket = /var/run/
[mysql_upgrade]
host = localhost
user = root
password =
socket = /var/run/
I guess Postinst did not try to log in with debian-sys-maint and no password.