mysql_upgrade fails with exit status 11
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.7 (Ubuntu) |
Confirmed
|
High
|
Unassigned |
Bug Description
c
ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.20-
ProcVersionSign
Uname: Linux 4.10.0-37-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
Date: Tue Oct 24 09:29:40 2017
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2017-10-13 (10 days ago)
InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
Logs.var.
Logs.var.
MySQLConf.
MySQLConf.
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
MySQLConf.
[mysqld_safe]
syslog
MySQLVarLibDirL
ProcCmdline: BOOT_IMAGE=
RelatedPackageV
dpkg 1.18.4ubuntu1.2
apt 1.2.24
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.20-
UpgradeStatus: No upgrade log present (probably fresh install)
upstart.
information type: | Private Security → Public |
tags: | removed: need-duplicate-check |
Changed in mysql-5.7 (Ubuntu): | |
importance: | Undecided → High |
summary: |
- package mysql-server-5.7 5.7.20-0ubuntu0.16.04.1 failed to - install/upgrade: subprocess installed post-installation script returned - error exit status 1 + mysql_upgrade fails with exit status 11 |
I had the same problem. It turns out it was mysql_upgrade exiting with an 'Error occurred: The mysql.session exists but is not correctly configured. The mysql.session needs SELECT privileges in the performance_schema database and the mysql.db table and also SUPER privileges.'
The way mysql_upgrade tries to check this requirement is with the query 'SELECT SUM(count)=3 FROM ( SELECT COUNT(*) as count FROM mysql.tables_priv WHERE Table_priv='Select' and User='mysql. session' and Db='mysql' and Table_name='user' UNION ALL SELECT COUNT(*) as count FROM mysql.db WHERE Select_priv='Y' and User='mysql. session' and Db='performance _schema' UNION ALL SELECT COUNT(*) as count FROM mysql.user WHERE Super_priv='Y' and User='mysql. session' ) as user_priv' which is quite a stupid way to do that.
And this failed in my case because i have 2 mysql.session users, one on localhost and one with '%' as host, so even tho my users were set up _exactly_ as mysql_upgrade demanded, it didn't warn me about the multiple users. Great check... Deleting one caused mysql_upgrade to pass and the dpkg system to return to normal (with an apt-get install -f)