Homebrew简称brew,OSX上的软件包管理工具,在Mac终端可以通过brew安装、更新、卸载各种软件,(简直就是神器级武器)。
废话不多说,没安装brew自己去百度学习安装,这里就不多说了。
1、首先在终端使用命令,这是搜索brew上的MySQL各个版本
brew search mysql
2、选择自己需要的版本,安装MySQL,这里我安装为5.7版本
brew install mysql@5.7
3、执行后稍等片刻,它会自动安装,以下为安装成功后显示的信息
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
mysql@5.7 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have mysql@5.7 first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.bash_profile
For compilers to find mysql@5.7 you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"
To have launchd start mysql@5.7 now and restart at login:
brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql@5.7/bin/mysql.server start
==> Summary
相关文章
- MySql安装成功后无法远程登录
- Mac系统下安装Homebrew后无法使用brew命令,-bash: brew: command not found
- mysql 安装完成后 无法登录 提示密码相关错误
- linux安装mysql后root无法登录 sql 无法登录
- 关于centos7中使用rpm方式安装mysql5.7版本后无法使用root登录的问题
- 安装mysql成功后无法启动怎么办
- Mac系统下安装Homebrew后无法使用brew命令
- 解决MySQL5.7安装后没有data文件夹无法登录的问题
- linux安装mysql后root无法登录
- 密码正确 mysql无法登陆 red7.3 上安装mysql5.6后登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passswd :yes)