MacOs 安装mysql 5.5

1. 首先安装homebrew. terminal下运行:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. 如果提示少cmake, 安装cmake
brew install cmake
3. 安装mysql5.5
brew reinstall mysql@5.5
安装完的版本就是5.5.62
4.启动mysql服务
 brew services start mysql@5.5

5.配置环境变量
建立~/.bash_profile
输入export PATH="/usr/local/opt/mysql@5.5/bin:$PATH"
source .bash_profile 使设置生效(重要,不然mysql就找不到)

6.进入mysql
mysql -uroot
7. 修改密码
mysql> set password for root@localhost = password(‘123’);

详细请参考这篇文章
https://blog.csdn.net/l0ve1o24/article/details/82764825
posted @ 2018-11-14 09:34  yt风往南吹  阅读(1172)  评论(0编辑  收藏  举报