1

I moved from mariadb to mysql (which worked). Now I wanted to upgrade mysql to 5.7 but it threw an error:

Running queries to upgrade MySQL server.
mysql_upgrade: (non fatal) [ERROR] 1728: Cannot load from mysql.proc. The table is probably corrupted
mysql_upgrade: (non fatal) [ERROR] 1545: Failed to open mysql.event
mysql_upgrade: [ERROR] 1072: Key column 'Id' doesn't exist in table
mysql_upgrade failed with exit status 5

I wanted to run mysqlcheck but it threw error:

Your password has expired. To log in you must change it using a client that supports expired passwords.

When I log in as root and want to SET PASSWORD I get this error

Column count of mysql.user is wrong. Expected 45, found 46.

When I want to start mysql with ignoring grant tables with

mysqld --skip-grant-tables

It fails silently.

What else can I try here? Reinstalling mysql results in the same

Key column 'Id' doesn't exist in table
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
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

error.

pythonimus
  • 293
  • 4
  • 15
  • I have no experience with this error but have searched for it for you. What are the last queries issued by the upgrade process? Than you may be able to find out if an existing table is missing a column or an index definition or so. See options on to do so [view live mysql queries](https://stackoverflow.com/questions/568564/how-can-i-view-live-mysql-queries) – Piemol Dec 02 '19 at 18:48

1 Answers1

0

I added skip-grant-tables to my.cnf and issued:

ALTER TABLE mysql.user DROP COLUMN is_role;

that deleted the extra column. Now I was able to update my passowrd again. The remaining problem is the following. Apt is stuck on unconfigured packages. If apt wants to configure them it issues mysql_upgrade which will fail with "Key column 'Id' doesn't exist in table". It does not provide any other information. How can I debug this?

Then I used logging of mysql queries as @Piemol suggested to trace the last query. The last query of msql_upgrade is:

ALTER TABLE slave_worker_info ADD Channel_name CHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'The channel on which the slave is connected to a source. Used in Multisource Replication', DROP PRIMARY KEY, ADD PRIMARY KEY(Channel_name, Id)
Quit

slave_worker_info had no column ID, so I dropped the table (as it was empty) and created it again ( https://dba.stackexchange.com/questions/54608/innodb-error-table-mysql-innodb-table-stats-not-found-after-upgrade-to-mys )

pythonimus
  • 293
  • 4
  • 15