Comment 12 for bug 1571865

Revision history for this message
maghfurin (furin-xiitkj) wrote : Re: [Bug 1571865] Re: mysql fails to start after upgrade if previous defaults were customised

furin@furin-K43SD:~$ sudo apt-get install -f
[sudo] password for furin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required:
  linux-headers-4.4.0-22 linux-headers-4.4.0-22-generic
  linux-headers-4.4.0-24 linux-headers-4.4.0-24-generic
  linux-image-4.4.0-22-generic linux-image-4.4.0-24-generic
  linux-image-extra-4.4.0-22-generic linux-image-extra-4.4.0-24-generic
  mysql-server-5.7 mysql-server-core-5.7
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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.12-0ubuntu1.1) ...
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.
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
Errors were encountered while processing:
 mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

On 18 July 2016 at 05:50, Francisco José Cañizares Santofimia <
<email address hidden>> wrote:

> Latest package in SUR doesn't solves the problem for me. Moreover, log
> in /var/log/mysql.log is empty. Can you tell me how can I provide debug
> info?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1571865
>
> Title:
> mysql fails to start after upgrade if previous defaults were
> customised
>
> Status in Release Notes for Ubuntu:
> Fix Released
> Status in mysql-5.7 package in Ubuntu:
> Fix Released
> Status in mysql-5.7 source package in Xenial:
> Fix Committed
>
> Bug description:
> In 14.04 (both in 5.5 and 5.6), the default /etc/mysql/my.cnf shipped
> with options "key-buffer" and "myisam-recover". In 5.7, these option
> names have been removed and replaced with "key-buffer-size" and
> "myisam-recover-options" instead. If a user customised
> /etc/mysql/my.cnf before, then the entire file is preserved, including
> the removed options, causing mysqld to fail to start after upgrade to
> 5.7 (eg. when upgrading to 16.04).
>
> [Impact]
> Server will fail to start, causing upgrade/installation of MySQL to fail.
>
> [Test case]
> 1. Install mysql-server in Ubuntu Trusty
> 2. Edit /etc/mysql/my.cnf and save it (can just add a comment)
> 3. Upgrade distro to Xenial
>
> Expected behavior:
> Server upgrades and starts normally
>
> Actual behavior:
> Server fails to upgrade, because it can't start, throwing an error about
> 'unknown option key_buffer'
>
> [Regression Potential]
> * If the sed command is faulty in some way it could mangle the options,
> leading to the server not starting and installation failing
>
> [Workarounds]
>
> If your customisations were made in 15.04 or 15.10 and
> /etc/mysql/my.cnf.migrated does not exist, then the workarounds below
> are still essentially the same but with a couple of exceptions:
>
> 1. Instead of editing /etc/mysql/my.cnf.migrated, edit the file you
> originally changed directly. This may be /etc/mysql/my.cnf (through
> the symlink), or a file you changed or added in either
> /etc/mysql/conf.d/ or /etc/mysql/mysql.conf.d/. The command "grep -Er
> 'key.buffer|myisam.recover' /etc/mysql" may help you in locating this.
>
> 2. No need to run update-alternatives to remove use of
> /etc/mysql/my.cnf.migrated.
>
> [Workaround Option 1/3]
>
> To reset your MySQL configuration back to defaults, type "sudo update-
> alternatives --remove my.cnf /etc/mysql/my.cnf.migrated" after the
> upgrade. Then use "sudo service mysql start" to start the MySQL daemon
> and "sudo apt-get -f install" to recover your system packaging state.
>
> This option is not available if /etc/mysql/my.cnf.migrated doesn't
> exist on your system, for example if your customisations were made on
> 15.04 or 15.10.
>
> [Workaround Option 2/3]
>
> For a quick fix while retaining your existing customised
> configuration, edit the [mysqld] section /etc/mysql/my.cnf.migrated as
> follows. But see the caveats detailed below and consider Workaround
> Option 3/3 instead first.
>
> 1. Replace "key_buffer" with "key_buffer_size". Note that there is a
> second occurrance of "key_buffer" under the [isamchk] section at the
> end of the file; changing this second occurrance is not necessary.
>
> 2. Replace "myisam-recover" with "myisam-recover-options".
>
> Then use "sudo service mysql start" to start the MySQL daemon again
> and "sudo apt-get -f install" to recover your system packaging state.
>
> However, this workaround does not put you in the best place for future
> upgrades, since packaging will continue to not be able to perfectly
> update this file while preserving your modifications. Additionally
> there may be parts of your previously customised configuration that
> still will not work with MySQL 5.7.
>
> To make future upgrades smoother in the future, consider following the
> next workaround option instead.
>
> [Workaround Option 3/3]
>
> Examine /etc/mysql/my.cnf.migrated for the customisations you made
> previously. You can find an original version of /etc/mysql/my.cnf as
> shipped with 14.04 at: http://bazaar.launchpad.net/~ubuntu-
>
> branches/ubuntu/trusty/mysql-5.5/trusty/view/head:/debian/additions/my.cnf
>
> Determine the changes you made to /etc/mysql/my.cnf. Taking only these
> changes and not the default contents of this file, add just your
> customisations into a new file at /etc/mysql/mysql.conf.d/zzlocal.cnf
> (preferred) and/or by editing /etc/mysql/mysql.conf.d/mysqld.cnf (to
> be avoided if possible) if necessary.
>
> Run: "sudo update-alternatives --remove my.cnf
> /etc/mysql/my.cnf.migrated" to switch to the new configuration scheme.
>
> Run: "sudo service mysql start" to start the MySQL daemon and "sudo
> apt-get -f install" to recover your system packaging state.
>
> [Original Description]
>
> Upgrading from 15.10 to 16.04 fails here
> Not sure if this is related to a bug report already reported.
>
> ProblemType: Package
> DistroRelease: Ubuntu 16.04
> Package: mysql-server-5.7 5.7.11-0ubuntu6
> ProcVersionSignature: Ubuntu 3.19.0-30.34-generic 3.19.8-ckt6
> Uname: Linux 3.19.0-30-generic x86_64
> ApportVersion: 2.20.1-0ubuntu2
> Architecture: amd64
> Date: Mon Apr 18 18:13:33 2016
> ErrorMessage: subprocess installed post-installation script returned
> error exit status 1
> InstallationDate: Installed on 2014-04-18 (731 days ago)
> InstallationMedia:
>
> Logs.var.log.daemon.log:
>
> MySQLConf.etc.mysql.conf.d.mysql.cnf: [mysql]
> MySQLConf.etc.mysql.conf.d.mysqld_safe_syslog.cnf:
> [mysqld_safe]
> syslog
> MySQLConf.etc.mysql.conf.d.mysqldump.cnf:
> [mysqldump]
> quick
> quote-names
> max_allowed_packet = 16M
> MySQLConf.etc.mysql.mysql.conf.d.mysqld_safe_syslog.cnf:
> [mysqld_safe]
> syslog
> MySQLVarLibDirListing: ['debian-5.7.flag', 'debian-5.5.flag',
> 'debian-5.6.flag', 'ib_logfile1', 'drupal8', 'servermail', 'ib_logfile0',
> 'auto.cnf', 'risenlif_risenlife2', 'dynazu_wiki', 'performance_schema',
> 'ibdata1', 'phpmyadmin', 'ib_buffer_pool', 'mysql_upgrade_info',
> 'parke_wiki', 'tracker', 'mysql']
> ProcCmdline: root=LABEL=DOROOT ro
> RelatedPackageVersions:
> dpkg 1.18.4ubuntu1
> apt 1.2.10ubuntu1
> SourcePackage: mysql-5.7
> Title: package mysql-server-5.7 5.7.11-0ubuntu6 failed to
> install/upgrade: subprocess installed post-installation script returned
> error exit status 1
> UpgradeStatus: Upgraded to xenial on 2016-04-18 (0 days ago)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu-release-notes/+bug/1571865/+subscriptions
>