install mysql on mac_Install mysql on Mac

Install mysql on Mac

这里使用 homebrew 安装。

安装命令:

brew install mysql

fdc527a0dcd908546402ca55dc345dfe.png

安装之后的命令,留一个备份。

Pruned 1 symbolic links and 2 directories from /usr/local

==> Caveats

==> [email protected]

A CA file has been bootstrapped using certificates from the system

keychain. To add additional certificates, place .pem files in

[email protected]/certs

and run

[email protected]/bin/c_rehash

[email protected] is keg-only, which means it was not symlinked into /usr/local,

because macOS provides LibreSSL.

If you need to have [email protected] first in your PATH run:

echo ‘export PATH="[email protected]/bin:$PATH"‘ >> ~/.zshrc

For compilers to find [email protected] you may need to set:

export LDFLAGS="[email protected]/lib"

export CPPFLAGS="[email protected]/include"

==> protobuf

Emacs Lisp files have been installed to:

/usr/local/share/emacs/site-lisp/protobuf

==> mysql

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

To have launchd start mysql now and restart at login:

brew services start mysql

Or, if you don‘t want/need a background service you can just run:

mysql.server start

相关命令:

启动: mysql.server start

停止: mysql.setver stop

登录: mysql -u root ; 登录root用户。

选择一个database : use erwa

查看所有的database: show databases

查看这个命令是干什么的:

man mysql

插入成功截图

b273b03fc351d2de2ab19dd228672ff7.png

TOPS:

1、更新homebrew的时候遇到了个小问题,卡了半天之后提示没有权限。

You should change the ownership of these directories to your user.

这里根据他的提示输入命令,然后提示输入当前用户的密码,给 赋予权限,然后重新执行OK。

7ddcc6c00f51ca9c0c63349318ff65a9.png

2、登录的时候没找到默认的初始密码。 尝试了一下不输入密码后,确实登录成功了。

原文:https://www.cnblogs.com/wobushitiegan/p/14032902.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值