gpt4 book ai didi

mysql - 升级失败,mysql.user 列数错误,密码过期

转载 作者:行者123 更新时间:2023-11-30 21:25:47 24 4
gpt4 key购买 nike

我从 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

错误。

最佳答案

我将 skip-grant-tables 添加到 my.cnf 并发出:

ALTER TABLE mysql.user DROP COLUMN is_role;

删除了额外的列。现在我可以再次更新我的密码了。剩下的问题如下。 Apt 卡在未配置的包上。如果 apt 想要配置它们,它会发出 mysql_upgrade,这将失败并显示“表中不存在键列‘Id’”。它不提供任何其他信息。我该如何调试?

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

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 没有列 ID,所以我删除了表(因为它是空的)并重新创建了它 ( https://dba.stackexchange.com/questions/54608/innodb-error-table-mysql-innodb-table-stats-not-found-after-upgrade-to-mys )

关于mysql - 升级失败,mysql.user 列数错误,密码过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59143024/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com