install mysql server in mac

2020-08-08  本文已影响0人  芒鞋儿

好像一般mysql server都装在cloud,而本地一般装workbench等client tool,不过有时候为了调试程序方便,也得装一下server.
虽然可以下载包安装,但是用brew 安装好像也蛮省事的。

  1. brew search mysql
  2. brew install mysql
    会出现以下msg:
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.server start 运行mysql
4.执行 mysql_secure_installation
根据提示选择password 种类,并设置pwd, 以及其他选项设置,

  1. mysql -u root -p
    用刚才的pwd 进入即可。
上一篇下一篇

猜你喜欢

热点阅读