升级失败,并出现mysql.user错误的列数和过期的密码

时间:2019-12-02 16:30:14

标签: mysql mariadb

我从mariadb迁移到mysql(有效)。现在我想将mysql升级到5.7,但是它抛出了一个错误:

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

我想运行mysqlcheck,但抛出错误:

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

当我以root用户身份登录并想要设置密码时,出现此错误

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

当我想使用忽略启动表的方式启动mysql

mysqld --skip-grant-tables

它无声地失败。

我还能在这里尝试什么?重新安装mysql结果相同

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

错误。

1 个答案:

答案 0 :(得分:0)

我在my.cnf中添加了skip-grant-tables并发出:

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

删除了多余的列。 现在,我可以再次更新密码了。 剩下的问题如下。 Apt卡在未配置的程序包上。如果apt要配置它们,则发出mysql_upgrade,它将失败,并且“表中不存在键列'Id'”。它不提供任何其他信息。我该如何调试呢?

然后我使用mysql查询的日志记录,因为@Piemol建议跟踪最后一个查询。 msql_upgrade的最后一个查询是:

{{1}}

slave_worker_info没有列ID,所以我删除了表(因为它为空)并再次创建它(https://dba.stackexchange.com/questions/54608/innodb-error-table-mysql-innodb-table-stats-not-found-after-upgrade-to-mys