HomeBrew 安装MySQL

网址

HomeBrew 搜索 MySQL https://formulae.brew.sh/formula/mysql#default

安装 MySQL

brew install mysql

MySQL 初始化账户

注: 本地数据库一般仅用来开发测试,所以忽略一些安全措施

mysql_secure_installation

输入 n , 回车, 不使用强度高的密码

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: n

输入root密码,回车, 需要输入两次, 比如: 123456

Please set the password for root here.

New password:
Re-enter new password:

输入 y , 回车,删除游客用户

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

输入 n, 回车,允许 root 远程登录

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

输入 y, 回车,删除测试的数据库

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

输入 y,回车, 重新加载权限

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

服务管理

重启 MySQL 服务

brew services restart mysql

启动 MySQL 服务

brew services start mysql

停止 MySQL 服务

brew services stop mysql
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值