brew服务列表显示mysql正在运行但无法连接

我按照说明从这里使用brew安装mysql
https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e

brew服务列表显示以下输出

Name  Status  User         Plist
MysqL started <username> /Users/<username>/Library/LaunchAgents/homebrew.mxcl.MysqL.plist

但是当我运行’MysqL’或’MysqLadmin -u root password”时,我收到错误.

ERROR 2002 (HY000): Can't connect to local MysqL server through socket '/tmp/MysqL.sock' (2)

任何人都可以在这里说出这个问题.

解决方法:

你的MysqL版本是什么?最近MysqL v8发布了,它引起了问题.

我建议先通过brew服务停止MysqL停止MysqL服务,然后通过brew uninstall MysqL卸载MysqL.

接下来,请通过执行rm -rf /usr/local/var / MysqL删除其数据文件夹.

之后请进行brew升级.

如果你想安装MysqL v5.7就行了

brew install MysqL@5.7&& brew链接–force MysqL@5.7&& brew服务启动MysqL@5.7

这也适用于MysqL@5.6和MysqL@5.5.

相关文章

最近做自动化测试时,深感自己对前端涉猎太少,加上对这块比...
homebrew本身就是一个git仓库。使用homebrew安装软件包时,会...
一、Homebrew安装、卸载等命令Homebrew的安装和卸载都非常简...
在mac系统中,使用homebrew可以很方便的管理包。按照官网的说...
我按照说明从这里使用brew安装mysqlhttps://gist.github.com...
我在macOS10.12.4上安装了nginx1.10.3和php5.5.38作为开发服...