3

APT isn't able to upgrade mySQL for me. I believe the 1045 error is due to login details. I'm able to run mysql_upgrade -uroot -p and finish it manually but how do I tell apt that it's done, please stop trying?

Setting up mysql-server-5.7 (5.7.24-0ubuntu0.16.04.1) ...
update-alternatives: warning: forcing reinstallation of alternative /etc/mysql/mysql.cnf because link group my.cnf is broken
update-alternatives: warning: not replacing /etc/mysql/my.cnf with a link
mysql_upgrade: Got error: 1045: Unknown error 1045 while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
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
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • 1
    concerning subprocess installed post-installation script returned error exit status 1: read my answer from this related problem https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server/793545#793545 – knb Oct 24 '18 at 19:38

2 Answers2

0

I had to recreate the debian-sys-maint user with the password from /etc/mysql/debian.cnf

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'PASSWORD';
0

If you disabled the mysql service at startup, the upgrade script fails to complete the update process. Therefore, you can enable the mysql service at startup and upgrade it like following,

sudo systemctl enable mysql.service

sudo apt update

sudo apt upgrade -y

If you want to disable mysql service at startup, you can disable it like following,

sudo systemctl disable mysql.service
Türkalp
  • 116