我是靠谱客的博主 美满柠檬,这篇文章主要介绍mac 安装mysql,现在分享给大家,希望可以做个参考。

mac 安装mysql

1. 安装homebrew
2. 用brew 安装mysql

执行brew install mysql,会出现类似的提示:

复制代码
1
2
3
4
5
6
7
8
9
10
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
3. 之后我们按照提示 执行 mysql_secure_installation

发现如下错误

复制代码
1
2
3
Securing the MySQL server deployment. Enter password for user root: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

这个错误的原因是我们没有开启mysql

4. 开启mysql 服务

执行mysql.server start 会提示 starting mysql, success.

5. 继续执行mysql_secure_installation

会提示你输入root 用户的password,还有其他一些的提示。

6. 进入mysql后台: mysql -u root -p
7. 退出mysql后台: 可以在mysql后台中执行 quit;
8. mysql关闭命令: mysql.server stop

最后

以上就是美满柠檬最近收集整理的关于mac 安装mysql的全部内容,更多相关mac内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(58)

评论列表共有 0 条评论

立即
投稿
返回
顶部