MySQL-mysql_upgrade-오류가 발생했습니다 : 서버 변수를 설정할 수 없습니다


10

공식 도커 이미지 내에서 MySQL 5.7.11을 실행합니다.

업그레이드하려고 할 때 다음 오류가 발생합니다.

mysql_upgrade -uroot -p
password:
Error occurred: Cannot setup server variables.

나는 주변을 검색했지만 힌트를 찾지 못했습니다. 나는 달리기를 시도 --verbose했지만 운이 없다.

db를 시작할 때의 로그는 다음과 같습니다.

db_1  | 2016-02-17T11:23:10.453190Z 0 [ERROR] Incorrect definition of table performance_schema.events_waits_current: expected column 'NESTING_EVENT_TYPE' at position 15 to have type enum('TRANSACTION','STATEMENT','STAGE','WAIT', found type enum('STATEMENT','STAGE','WAIT').
db_1  | 2016-02-17T11:23:10.453233Z 0 [ERROR] Incorrect definition of table performance_schema.events_waits_history: expected column 'NESTING_EVENT_TYPE' at position 15 to have type enum('TRANSACTION','STATEMENT','STAGE','WAIT', found type enum('STATEMENT','STAGE','WAIT').
db_1  | 2016-02-17T11:23:10.453275Z 0 [ERROR] Incorrect definition of table performance_schema.events_waits_history_long: expected column 'NESTING_EVENT_TYPE' at position 15 to have type enum('TRANSACTION','STATEMENT','STAGE','WAIT', found type enum('STATEMENT','STAGE','WAIT').
db_1  | 2016-02-17T11:23:10.453411Z 0 [ERROR] Incorrect definition of table performance_schema.events_waits_summary_by_user_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.453451Z 0 [ERROR] Incorrect definition of table performance_schema.events_waits_summary_by_account_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.453799Z 0 [ERROR] Column count of performance_schema.setup_actors is wrong. Expected 5, found 3. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.453902Z 0 [ERROR] Incorrect definition of table performance_schema.setup_objects: expected column 'OBJECT_TYPE' at position 0 to have type enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER', found type enum('TABLE').
db_1  | 2016-02-17T11:23:10.454171Z 0 [ERROR] Column count of performance_schema.table_lock_waits_summary_by_table is wrong. Expected 68, found 73. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454237Z 0 [ERROR] Column count of performance_schema.threads is wrong. Expected 17, found 14. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454316Z 0 [ERROR] Column count of performance_schema.events_stages_current is wrong. Expected 12, found 10. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454375Z 0 [ERROR] Column count of performance_schema.events_stages_history is wrong. Expected 12, found 10. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454429Z 0 [ERROR] Column count of performance_schema.events_stages_history_long is wrong. Expected 12, found 10. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454559Z 0 [ERROR] Incorrect definition of table performance_schema.events_stages_summary_by_account_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.454614Z 0 [ERROR] Incorrect definition of table performance_schema.events_stages_summary_by_user_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.454807Z 0 [ERROR] Column count of performance_schema.events_statements_current is wrong. Expected 41, found 40. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454908Z 0 [ERROR] Column count of performance_schema.events_statements_history is wrong. Expected 41, found 40. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.454983Z 0 [ERROR] Column count of performance_schema.events_statements_history_long is wrong. Expected 41, found 40. Created with MySQL 50626, now running 50711. Please use mysql_upgrade to fix this error.
db_1  | 2016-02-17T11:23:10.455093Z 0 [ERROR] Incorrect definition of table performance_schema.events_statements_summary_by_account_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.455151Z 0 [ERROR] Incorrect definition of table performance_schema.events_statements_summary_by_user_by_event_name: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.455347Z 0 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_program' has the wrong structure
db_1  | 2016-02-17T11:23:10.455367Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_current' has the wrong structure
db_1  | 2016-02-17T11:23:10.455383Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history' has the wrong structure
db_1  | 2016-02-17T11:23:10.455400Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_history_long' has the wrong structure
db_1  | 2016-02-17T11:23:10.455419Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_thread_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455437Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_account_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455456Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_user_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455474Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_by_host_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455492Z 0 [ERROR] Native table 'performance_schema'.'events_transactions_summary_global_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455542Z 0 [ERROR] Incorrect definition of table performance_schema.users: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.455591Z 0 [ERROR] Incorrect definition of table performance_schema.accounts: expected column 'USER' at position 0 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.455916Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_global_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455952Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_account_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455974Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_host_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.455995Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_thread_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.456018Z 0 [ERROR] Native table 'performance_schema'.'memory_summary_by_user_by_event_name' has the wrong structure
db_1  | 2016-02-17T11:23:10.456046Z 0 [ERROR] Native table 'performance_schema'.'table_handles' has the wrong structure
db_1  | 2016-02-17T11:23:10.456075Z 0 [ERROR] Native table 'performance_schema'.'metadata_locks' has the wrong structure
db_1  | 2016-02-17T11:23:10.456095Z 0 [ERROR] Native table 'performance_schema'.'replication_connection_configuration' has the wrong structure
db_1  | 2016-02-17T11:23:10.456109Z 0 [ERROR] Native table 'performance_schema'.'replication_group_members' has the wrong structure
db_1  | 2016-02-17T11:23:10.456122Z 0 [ERROR] Native table 'performance_schema'.'replication_connection_status' has the wrong structure
db_1  | 2016-02-17T11:23:10.456136Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_configuration' has the wrong structure
db_1  | 2016-02-17T11:23:10.456148Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status' has the wrong structure
db_1  | 2016-02-17T11:23:10.456163Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status_by_coordinator' has the wrong structure
db_1  | 2016-02-17T11:23:10.456176Z 0 [ERROR] Native table 'performance_schema'.'replication_applier_status_by_worker' has the wrong structure
db_1  | 2016-02-17T11:23:10.456190Z 0 [ERROR] Native table 'performance_schema'.'replication_group_member_stats' has the wrong structure
db_1  | 2016-02-17T11:23:10.456202Z 0 [ERROR] Native table 'performance_schema'.'prepared_statements_instances' has the wrong structure
db_1  | 2016-02-17T11:23:10.456217Z 0 [ERROR] Native table 'performance_schema'.'user_variables_by_thread' has the wrong structure
db_1  | 2016-02-17T11:23:10.456229Z 0 [ERROR] Native table 'performance_schema'.'status_by_account' has the wrong structure
db_1  | 2016-02-17T11:23:10.456244Z 0 [ERROR] Native table 'performance_schema'.'status_by_host' has the wrong structure
db_1  | 2016-02-17T11:23:10.456261Z 0 [ERROR] Native table 'performance_schema'.'status_by_thread' has the wrong structure
db_1  | 2016-02-17T11:23:10.456274Z 0 [ERROR] Native table 'performance_schema'.'status_by_user' has the wrong structure
db_1  | 2016-02-17T11:23:10.456287Z 0 [ERROR] Native table 'performance_schema'.'global_status' has the wrong structure
db_1  | 2016-02-17T11:23:10.456299Z 0 [ERROR] Native table 'performance_schema'.'session_status' has the wrong structure
db_1  | 2016-02-17T11:23:10.456311Z 0 [ERROR] Native table 'performance_schema'.'variables_by_thread' has the wrong structure
db_1  | 2016-02-17T11:23:10.456325Z 0 [ERROR] Native table 'performance_schema'.'global_variables' has the wrong structure
db_1  | 2016-02-17T11:23:10.456339Z 0 [ERROR] Native table 'performance_schema'.'session_variables' has the wrong structure
db_1  | 2016-02-17T11:23:10.456385Z 0 [ERROR] Incorrect definition of table mysql.db: expected column 'User' at position 2 to have type char(32), found type char(16).
db_1  | 2016-02-17T11:23:10.456395Z 0 [ERROR] mysql.user has no `Event_priv` column at position 28
db_1  | 2016-02-17T11:23:10.456488Z 0 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
db_1  | 2016-02-17T11:23:10.456574Z 0 [Note] mysqld: ready for connections.
db_1  | Version: '5.7.11'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

어떤 버전에서?
Rick James

당신은 로그에서 볼 수 있습니다 :Created with MySQL 50626, now running 50711.
피에르 Ozoux


@RickJames에게 감사합니다! bugs.mysql.com/bug.php?id=80454
Pierre Ozoux

1
필자의 경우 액세스 권한이없는 사용자로 업그레이드하려고했습니다.
Sammy Larbi

답변:


15

해결 방법을 찾았습니다!

db를 중지하십시오. 그런 다음 시작하십시오.

mysqld --skip-grant-tables &

그런 다음 마침내 업그레이드를 수행 할 수있었습니다.

mysql_upgrade

내가 가지고 Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock만든 첫 번째 오류를 /var/run/mysqld다음 chown mysql:mysql /var/run/mysqld다음 MySQL의를 시작 mysql_upgrade했다.
endo64

0

apt-getDocker 이미지를 사용 하지 않고 기본 Ubuntu 16.04 EC2 인스턴스를 사용하여 5.7.x에서 5.7.15로 업그레이드 할 때 비슷한 문제가 발생했습니다 .

.mylogin.cnfLinux 루트 사용자 계정에 파일을 설정 하여 사용자 이름과 비밀번호를 입력하지 않고 로그인 한 다음 mysql_upgrade루트 계정에 로그인 한 상태에서 명령 을 실행할 수있었습니다 .

필요한 시스템 테이블 업그레이드를 수행 한 후 apt-get upgrade문제없이 명령 을 완료 할 수있었습니다 .


0

내 꺼야

mv /var/lib/mysql /var/lib/mysql.bak

기본 mysql 데이터베이스 만있는 새 / var / lib / mysql 폴더를 복사하십시오. 방금 / var / lib / mysql-new에 하나를 저장했습니다.

mv /var/lib/mysql-new /var/lib/mysql
service mysql restart

apt-get install -f

mysql 데이터베이스를 통해 업그레이드하고 다음을 수행 할 수 있습니다.

 mv /var/lib/mysql /var/lib/mysql-new
 mv /var/lib/mysql.bak /var/lib/mysql
 service mysql restart

나를 위해 일했다. 나는 퍼지, 모든 것을 삭제하고 다시 시작하는 것, 의복을 가지고 노는 등의 다른 제안을 시도했지만 이것이 나를 위해 일한 유일한 방법이었습니다.


0

내 경우에는 같은 문제가 다음과 같이 해결되었습니다.

$ mysql_upgrade db_username@db_host -p
Enter password:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.

StackExchange 사이트에 오신 것을 환영합니다. 항상 다른 전문가에게 이해하기 위해 코드와 함께 설명을 작성하십시오.
Md Haidar Ali Khan
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.