MySQL Fails to Start After `brew upgrade` from Version 5.7 to 8.0

TL;DR: If mysqldfails to start after running brew upgrade, try re-running the upgrade process manually.


A few weeks ago I went to install something via Homebrew, and it bugged me to run brew upgrade first, so I did, without really thinking about the consequences.

That upgraded all of the installed packaged to their latest versions, including jumping to new major versions.

I didn’t notice any big problems at the time, but after rebooting my computer today, I noticed that the MySQL service wasn’t running anymore. I checked the error log, and a lot of errors like these:

2018-07-19T15:45:04.652847Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfBadLeechers is not found in InnoDB dictionary
2018-07-19T15:45:04.652872Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfBadLeechers
2018-07-19T15:45:04.653695Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfBlockedCommentLog is not found in InnoDB dictionary
2018-07-19T15:45:04.653716Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfBlockedCommentLog
2018-07-19T15:45:04.654644Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfBlockedIPLog is not found in InnoDB dictionary
2018-07-19T15:45:04.654664Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfBlockedIPLog
2018-07-19T15:45:04.655657Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfBlocks is not found in InnoDB dictionary
2018-07-19T15:45:04.655677Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfBlocks
2018-07-19T15:45:04.656875Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfBlocks7 is not found in InnoDB dictionary
2018-07-19T15:45:04.656895Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfBlocks7
2018-07-19T15:45:04.658150Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfBlocksAdv is not found in InnoDB dictionary
2018-07-19T15:45:04.658170Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfBlocksAdv
2018-07-19T15:45:04.658952Z 2 [ERROR] [MY-012083] [InnoDB] InnoDB: Table regolith@002elocalhost/wp_wfConfig is not found in InnoDB dictionary
2018-07-19T15:45:04.658972Z 2 [ERROR] [MY-010767] [Server] Error in fixing SE data for regolith.localhost.wp_wfConfig

[...]

2018-07-19T15:45:06.518136Z 0 [ERROR] [MY-010022] [Server] Failed to Populate DD tables.
2018-07-19T15:45:06.518169Z 0 [ERROR] [MY-010119] [Server] Aborting

In my case, I got those errors for all the WordFence tables for several sites, but not all of the sites that have those tables. I tried searching for information on those errors, but didn’t find anything that was helpful.

I then tried running mysqlcheck, and got an even more ominous error:

> mysqlcheck -uroot -p --repair --all-databases
Enter password:
mysqlcheck: Error: Couldn't execute 'SHOW DATABASES': The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

Luckily, searching for that error did turn up a solution from Stack Overflow:

> mysql -u root -p
mysql> SET GLOBAL innodb_fast_shutdown = 1;
mysql> quit;
> mysql_upgrade -u root -p

After running that and restarting the service, everything was working normally again.

Leave a Reply

Your email address will not be published. Required fields are marked *