HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlModerate

MySQL - mysql_upgrade - Error occurred: Cannot setup server variables

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
mysql_upgradecannoterrormysqlsetupvariablesserveroccurred

Problem

I run MySQL 5.7.11 inside the official docker image.

When I want to upgrade I get the following error:

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


I searched around, didn't find any hint. I tried to run with --verbose, but no luck.

For reference here are the logs when I start the 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('EV

Solution

I found a workaround!

Stop your db. Then start it with:

mysqld --skip-grant-tables &


And then, I could finally do my upgrade:

mysql_upgrade

Code Snippets

mysqld --skip-grant-tables &
mysql_upgrade

Context

StackExchange Database Administrators Q#129525, answer score: 18

Revisions (0)

No revisions yet.