mac下安装mysql5.7_mac下安装mysql5.7

本文介绍了在Mac上使用Homebrew安装MySQL 5.7的完整过程,包括安装命令、环境变量配置、启动服务以及创建软链接。通过执行Homebrew的指令,确保MySQL 5.7成功安装并准备就绪。
摘要由CSDN通过智能技术生成

-Pro in ~/www/l_project on git:test x [16:26:44] C:1$ brew search mysql==>Formulae

automysqlbackup mysql-client mysql-connector-c++ mysql-utilities mysql@5.7mysql mysql-cluster mysql-sandbox mysql@5.5mysqltuner

mysql++ mysql-connector-c mysql-search-replace mysql@5.6

==>Casks

mysql-connector-python mysql-utilities navicat-for-mysql

mysql-shell mysqlworkbench sqlpro-for-mysql

# tk @ MacBook-Pro in ~/www/l_project on git:test x [16:28:15]

$ brewinstall mysql@5.7Warning: You are using macOS10.15.

Wedo not provide support for this pre-release version.

You will encounter build failures with some formulae.

Please create pull requests instead of askingfor help on Homebrew‘s GitHub,

Discourse, Twitter or IRC. You are responsible forresolving any issues you

experience, as you are running this pre-release version.==> Downloading https://homebrew.bintray.com/bottles/mysql@5.7-5.7.26.mojave.bottle.tar.gz

==> Downloading from https://akamai.bintray.com/81/815ae8aa8c765f57e806ff9197eaa5783b138c493d68333c553b25f441b6af3e?__gda__

######################################################################## 100.0%

==> Pouring mysql@5.7-5.7.26.mojave.bottle.tar.gz==> /usr/local/Cellar/mysql@5.7/5.7.26/bin/mysqld --initialize-insecure --user=tankun --basedir=/usr/local/Cellar/mysql@5.7

==>Caveats

We‘ve installed your MySQL database without a root password. To secure it run:

mysql_secure_installation

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 inyour PATH run:echo ‘export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"‘ >> ~/.zshrc

For compilers tofind mysql@5.7you 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.7Or,if you don‘t want/need a background service you can just run:

/usr/local/opt/mysql@5.7/bin/mysql.server start==>Summary

??/usr/local/Cellar/mysql@5.7/5.7.26: 320 files, 231.8MB==> `brew cleanup` has not been run in 30days, running now...

Removing:/Users/tk/Library/Caches/Homebrew/lrzsz--0.12.20_1.mojave.bottle.tar.gz... (156KB)

Removing:/Users/tk/Library/Caches/Homebrew/Cask/docker--2.0.0.3-ce-mac81,31259.dmg... (521.5MB)

Removing:/Users/tk/Library/Logs/Homebrew/telnet... (64B)

#按照安装提示依次执行

# tk @ MacBook-Pro in ~/www/l_project on git:test x [16:33:19] C:127$echo ‘export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"‘ >> ~/.zshrc

# tk @ MacBook-Pro in ~/www/l_project on git:test x [16:34:17]

$ export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"# tk @ MacBook-Pro in ~/www/l_project on git:test x [16:34:43]

$ export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"#启动mysql用,暂时用不上

#brew services start mysql@5.7#创建软链

# tk @ MacBook-Pro in ~/www/l_project on git:test x [16:50:37] C:127$ln -s /usr/local/opt/mysql@5.7/bin/mysql /usr/local/bin/mysql

#查看mysql版本

# tk @ MacBook-Pro in ~/www/l_project on git:test x [17:39:26]

$ mysql-V

mysql Ver14.14 Distrib 5.7.26, for osx10.14 (x86_64) using EditLine wrapper

mac下安装mysql5.7

标签:local   wan   secure   macbook   work   config   use   disco   ase

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:https://www.cnblogs.com/wscsq789/p/12236439.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值