mac os Mojave中brew安装的mysql因升级导致无法启动问题的解决

估计是手欠,一不小心把mysql5.7升到8.0.15,版本高看着就爽啊。
结果是mysql起不起来了。。。

于是想了各种办法:

  • 办法1:把版本降回去。结果还是不能启动,说的是用到了高版本的文件,需要删除所有的数据重装,这是万万不能接受的。
  • 办法2:看错误日志一个问题一个问题解。结果花了一下午,仍然没有搞定。直到。。。找到这个错误
[ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist

然后在google上搜“[ERROR] [MY-013129] [Server]”,原来已经有人遇到同样的问题了:

https://bugs.mysql.com/bug.php?id=89267

1. stop 5.7.21
2. swap binaries for 8.0.4
3. start mysql with skip-networking and skip-grant-tables etc.
4. sudo mysql_upgrade --no-defaults $(sudo my_print_defaults client | egrep '^--socket' | head -1)
5. restart mysql

依样画葫芦:

1.brew services stop mysql
2.mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3.sudo mysql_upgrade --no-defaults $(sudo my_print_defaults client | egrep '^--socket' | head -1)
4.brew services start mysql

问题解决

猜你喜欢

转载自blog.51cto.com/ustb80/2384166