programing

mysql.user 잘못된 열 수 및 만료된 암호로 인해 업그레이드가 실패함

codeshow 2023. 8. 20. 12:58
반응형

mysql.user 잘못된 열 수 및 만료된 암호로 인해 업그레이드가 실패함

저는 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.

루트로 로그인하고 비밀번호를 설정하려고 하면 이 오류가 발생합니다.

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

오류

나는 my.cnf에 skip-grant-tables를 추가하고 다음을 발행했습니다.

ALTER TABLE mysql.user DROP COLUMN is_role;

추가 열을 삭제했습니다.이제 비밀번호를 다시 업데이트할 수 있었습니다.남은 문제는 다음과 같습니다.구성되지 않은 패키지에 App이 고착되었습니다.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 ).

언급URL : https://stackoverflow.com/questions/59143024/upgrade-fails-with-mysql-user-wrong-column-count-and-expired-password

반응형