MySQL5.7的Homebrew安装 - MacOS

MySQL5.7的Homebrew安装 - MacOS

安装完数据库,如出现如下报错

Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2)

解决方式如下:

# First uninstall mysql
brew uninstall mysql@5.7
# Delete the folders/files that were not removed
rm -rf /usr/local/var/mysql
rm /usr/local/etc/my.cnf
# Reinstall mysql and link it
brew install mysql@5.7
brew link --force [email protected]
# Enable and start the service
brew services start mysql@5.7

你可能感兴趣的:(macos,数据库,mysql)