当前位置:首页 > 数据库 > 正文

mac安装mysql

2020-03-01 数据库

mac使用brew安装mysql

1 先查看mac上边有没有安装brew;

  brew -v  可查看brew版本

  没有安装可先安装brew:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2 检查brew能否正常工作:brew doctor

3 更新brew包:brew update

4 安装mysql:brew insatll mysql

5 后台启动mysql:brew services start mysql   // 重启:brew services restart mysql

6 启动MySQL服务:mysql.server start    //  需要权限时可以用 sodu mysql.server start 启动

7 设置密码:mysql_secure_installation

8 连接mysql:mysql -uroot -p<you password>  例子:mysql -uroot -p123456  也可以输入 mysql -uroot -p 回车输入密码

 

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/21682.html