Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQLd doesn't start after brew upgrade from 5.6 to 5.7

Tags:

mysql

homebrew

a few days back I let brew update all my formulars like always but this time mysqld doesn't start back up again.

This is the error message:

2016-03-22T13:58:22.515719Z 0 [ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
2016-03-22T13:58:22.515819Z 0 [ERROR] Aborting

But since I cannot get the server started, I cannot get mysql_upgrade running:

mysql_upgrade: Got error: 2013: Lost connection to MySQL server at 'reading initial communication packet', system error: 102 while connecting to the MySQL server
Upgrade process encountered error and will not continue.

So what can I do to get this working again? Would a brew uninstall mysql and reinstall help in any way?

like image 205
Cojones Avatar asked Mar 22 '16 14:03

Cojones


1 Answers

First, start your mysql without reading the user table: mysqld --skip-grant-tables

Then run mysql_upgrade which should now run smoothly.

Next stop mysqld: killall mysqld.

Now you should be able to start up your mysql service normally again.

like image 167
bb. Avatar answered Sep 23 '22 21:09

bb.