brew 安装mysql (MacOS )
前⾔
本⽂记录⼀下mac安装mysql的⼀些过程。
mysql社区版国内镜像下载没有brew的⼩伙伴可以看看这个 , 该⽹站有安装的命令(国内在镜像下安装⽐较快)。brew很⽅便也很推荐,例如装些Nginx, redis啥的也很⽅便。
安装
推荐使⽤5.7的版本,暂时还不推荐新版本。
然后就会⾃⼰安装⼀系列东西。然后就以输出⼀些提⽰信息.
⽂字版本, ⽅便后期拷贝命令hhhm brew install mysql@5.7
1
设置路径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 /opt/ho
mebrew,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="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc For compilers to find mysql@5.7 you may need to set: export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib" export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"To start mysql@5.7: brew services start mysql@5.7Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql ==> Summary /opt/homebrew/Cellar/mysql@5.7/5.7.36: 320 files, 233.3MB ==> `brew cleanup` has not been run in the last 30 days, Removing: /Users/andydennis/Library/Logs/ (64B)Pruned 0 symbolic links and 2 directories from /opt/homebrew ==> Caveats ==> mysql@5.7We'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 /opt/homebrew,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="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc For compilers to find mysql@5.7 you may need to set: export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib" export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"T
o start mysql@5.7: brew services start mysql@5.7Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH "' >> ~/.zshrc 1
启动
记住安装后要重开⼀个终端界⾯再启动1
mysql.server start
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论