mac下安装mysql5.7

自己mac电脑安装mysql,这里记录下,方便后面升级mysql或遇到版本兼容问题作出排查.

#搜索查看可用版本
# tk @ MacBook-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          [email protected]5.7
mysql                    mysql-cluster            mysql-sandbox            [email protected]5.5                mysqltuner
mysql++                  mysql-connector-c        mysql-search-replace     [email protected]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]
$ brew install [email protected]5.7
Warning: You are using macOS 10.15.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew‘s GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience, as you are running this pre-release version.

==> Downloading https://homebrew.bintray.com/bottles/[email protected]
==> Downloading from https://akamai.bintray.com/81/815ae8aa8c765f57e806ff9197eaa5783b138c493d68333c553b25f441b6af3e?__gda__
######################################################################## 100.0%
==> Pouring [email protected]5.7-5.7.26.mojave.bottle.tar.gz
==> /usr/local/Cellar/[email protected]5.7/5.7.26/bin/mysqld --initialize-insecure --user=tankun --basedir=/usr/local/Cellar/[email protected]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

[email protected]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 [email protected]5.7 first in your PATH run:
  echo ‘export PATH="/usr/local/opt/[email protected]/bin:$PATH"‘ >> ~/.zshrc

For compilers to find [email protected]5.7 you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

To have launchd start [email protected]5.7 now and restart at login:
  brew services start [email protected]5.7
Or, if you don‘t want/need a background service you can just run:
  /usr/local/opt/[email protected]5.7/bin/mysql.server start
==> Summary
??  /usr/local/Cellar/[email protected]5.7/5.7.26: 320 files, 231.8MB
==> `brew cleanup` has not been run in 30 days, 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/[email protected]/bin:$PATH"‘ >> ~/.zshrc

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

# tk @ MacBook-Pro in ~/www/l_project on git:test x [16:34:43]
$  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

#启动mysql用,暂时用不上
#brew services start [email protected]5.7

#创建软链
# tk @ MacBook-Pro in ~/www/l_project on git:test x  [16:50:37] C:127
$ ln -s /usr/local/opt/[email protected]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  Ver 14.14 Distrib 5.7.26, for osx10.14 (x86_64) using  EditLine wrapper

原文地址:https://www.cnblogs.com/wscsq789/p/12236439.html

时间: 2024-11-08 21:24:42

mac下安装mysql5.7的相关文章

mac下安装mysql5.7.18,连接出现Access denied for user 'root'@'localhost' (using password: YES)

mac下,mysql5.7.18连接出错,错误信息为:Access denied for user 'root'@'localhost' (using password: YES) ()里面的为shell中输入的命令,一定要输全包括:&等符号 第一步:苹果->系统偏好设置->最下面点MySQL,关闭mysql服务 第二步:进入终端输入(cd /usr/local/mysql/bin/)回车 输入(sudo su)回车以获取管理员权限 输入(./mysqld_safe --skip-gr

在mac下安装了MySqL + MySQLWorkbench + PyCharm

今天在mac下安装了MySqL  +   MySQLWorkbench + PyCharm 安装这些东西没有在windows下熟悉. 在Mac下安装程序真的不是很适应,感觉很不爽!!!安装完成后还是蛮高兴,后面可以做自己要做的事情了. 通过查阅各种各样的资料,去安装这些东东.最后经过一番周折终于安装完成.下面是对安装过程和遇到的问题做个简单记录. 一.下载MySQL和MySQL Workbench http://dev.mysql.com/downloads/mysql/ 选择合适自己Mac 版

Mac下安装MySQL 5.6.40

Mac下安装MySQL 5.6.40 - 干勾鱼的CSDN博客 - CSDN博客 原创 Mac下安装MySQL 5.6.40 2018-06-18 10:34:03 我是干勾鱼 阅读数 5927 分类专栏: MYSQL MYSQL常见问题解析 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/dongdong9223/article/details/80722654 转载请注明出处:http

Linux(Red Hat 6 32位) 下安装Mysql5.6.30

1. 下载MySQL 5.6 下载页面:http://dev.mysql.com/downloads/mysql/ 此处选择"Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 32-bit), RPM Bundle"下载,下载至/root/fuxian/目录下,下载文件名为"MySQL-5.6.30-1.el6.i686.rpm-bundle.tar" 2. 解压tar包 cd /fuxian/Downloads/

mac下,mysql5.7.18连接出错,错误信息为:Access denied for user 'root'@'localhost' (using password: YES)

mac下,mysql5.7.18连接出错,错误信息为:Access denied for user 'root'@'localhost' (using password: YES)()里面的为shell中输入的命令,一定要输全包括:&等符号 第一步:苹果->系统偏好设置->最下面点MySQL,关闭mysql服务 第二步:进入终端输入(cd /usr/local/mysql/bin/)回车输入(sudo su)回车以获取管理员权限输入(./mysqld_safe --skip-grant

CentOS-7下安装MySQL5.6.22

CentOS7下安装MySQL5.6.22(当前最新版本:2015-01-17) 转载请注明出处:jiq?钦's technical Blog 一  安装环境 (1)CentOS版本:CentOS-7 查看方法: [[email protected] 桌面]# cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core) 来源:官网下载 下载地址:http://www.centos.org/ (2)MySQL版本:MySQL-5.6.2

mac下安装mongoDB

方式一:命令行 MongoDB的安装有好多种安装方法,有普通青年的HomeBrew方式,也有文艺青年的源码编译方式.我只想快速的装起来用一下,所以我选最简单的HomeBrew. 请参考官方文档 : http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ 更新Homebrew的package数据库,在Mac的终端中输入: $ brew update 然后耐心等待,这个没有任何显示,估计要几分钟,取决于网络的速度.然后就列出了

mac下安装配置java开发环境

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica; color: #000000 } p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica; color: #000000; min-height: 13.0px } p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #

Mac下安装LNMP(Nginx+PHP5.6)环境

Mac下安装LNMP(Nginx+PHP5.6)环境 安装Homebrew 最近工作环境切换到Mac,所以以OS X Yosemite(10.10.1)为例,记录一下从零开始安装Mac下LNMP环境的过程 确保系统已经安装xcode,然后使用一行命令安装依赖管理工具Homebrew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 之后就可以使用 brew