Public bug reported: I have a server. It was running 14.04 and after release of 16.04 got updated. MySQL failed terribly but I got it working by checking update scripts and forcing mysql-upgrade.
Now update of mysql packages ends with: Setting up mysql-server-5.7 (5.7.13-0ubuntu0.16.04.2) ... Renaming removed key_buffer and myisam-recover options (if present) Checking if update is needed. Checking server version. Running queries to upgrade MySQL server. mysql_upgrade: [ERROR] 1813: Tablespace '`mysql`.`innodb_table_stats`' exists. mysql_upgrade failed with exit status 5 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 11:13 root@malenstwo:mysql# mysql_upgrade -f Checking server version. Running queries to upgrade MySQL server. mysql_upgrade: [ERROR] 1813: Tablespace '`mysql`.`innodb_table_stats`' exists. mysql_upgrade: [ERROR] 1813: Tablespace '`mysql`.`innodb_index_stats`' exists. mysql_upgrade: [ERROR] 1146: Table 'mysql.innodb_table_stats' doesn't exist mysql_upgrade: [ERROR] 1146: Table 'mysql.innodb_index_stats' doesn't exist Checking system database. mysql.columns_priv OK mysql.db OK mysql.engine_cost OK mysql.event OK mysql.func OK mysql.general_log OK mysql.gtid_executed OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK mysql.help_topic OK mysql.host OK mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.proxies_priv OK mysql.server_cost OK mysql.servers OK mysql.slave_master_info OK mysql.slave_relay_log_info OK mysql.slave_worker_info OK mysql.slow_log OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK The sys schema is already up to date (version 1.5.0). [.. dropped list of db/tables ..] Upgrade process completed successfully. Checking if update is needed. 11:13 root@malenstwo:mysql# LC_ALL=C dpkg --configure -a Setting up mysql-server-5.7 (5.7.13-0ubuntu0.16.04.2) ... Renaming removed key_buffer and myisam-recover options (if present) Checking if update is needed. This installation of MySQL is already upgraded to 5.7.13, use --force if you still need to run mysql_upgrade Setting up mysql-server (5.7.13-0ubuntu0.16.04.2) ... 11:14 root@malenstwo:mysql# Will I have to force mysql_upgrade after each package update? ** Affects: mysql-5.7 (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1621389 Title: mysql_upgrade: [ERROR] 1813: Tablespace '`mysql`.`innodb_table_stats`' exists. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1621389/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs