Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld ...
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/init/mysql.conf ...
Installing new version of config file /etc/mysql/mysql.conf.d/mysqld.cnf ...
invoke-rc.d: Unit mysql.service is masked
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
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
From log:
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ... d/usr.sbin. mysqld ... mysql.conf ... mysql.conf. d/mysqld. cnf ... alternatives: using /etc/mysql/ mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode .`innodb_ table_stats` ' exists.
Installing new version of config file /etc/apparmor.
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/init/
Installing new version of config file /etc/mysql/
invoke-rc.d: Unit mysql.service is masked
update-
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
mysql_upgrade: [ERROR] 1813: Tablespace '`mysql`
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
error.log has various errors of the form:
2016-04- 26T09:54: 39.310881Z 0 [ERROR] /usr/sbin/mysqld: Can't find file: './performance_ schema/ cond_instances. frm' (errno: 13 - Permission denied)