mac 本地安装mysql服务

释放双眼,带上耳机,听听看~!

brew install mysql
启动mysyql服务

mysql.server start

也可以启动后台服务 ,开机后自动重启

brew services start mysql

mysql的相关配置

mysql_secure_installation

参照如下,根据情况进行设置

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN 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 plugin?

Press y|Y for Yes, any other key for No:
Please set the password for root here.

New password:

Re-enter new password:
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

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

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

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

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

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

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

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

All done!
点击查看更多内容

0人点赞

若觉得本文不错,就分享一下吧!

评论

评论

共同学习,写下你的评论

评论加载中…

展开查看更多评论

相关文章推荐

正在加载中


  • 推荐

  • 评论

  • 收藏
  • 共同学习,写下你的评论




举报

0/150

提交
取消

【转自慕课】https://www.imooc.com

Python

Python缩进和选择学习

2022-3-3 4:53:35

Python

Python装饰器模式

2022-3-3 4:55:39

搜索