美文网首页
Mac下mysql的安装与卸载

Mac下mysql的安装与卸载

作者: 咸鱼懒得翻身 | 来源:发表于2017-08-20 10:21 被阅读0次

使用homebrew安装mysql

1、安装mysql

brew install mysql

2、启动mysql服务

mysql.server start

3、设置root密码

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: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file
// 选一个密码强度等级
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.
// 按照所选的密码强度要求设定密码
New password:

Re-enter new password:

Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y

//密码不满足密码强度
 ... Failed! Error: Your password does not satisfy the current policy requirements

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
//密码满足了密码强度
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.

// 是否禁止远程root登录
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : no

 ... 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.

// 是否删除默认自带的test数据库
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!

4、登陆

mysql -u root -p

卸载mysql

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
vim /etc/hostconfig  (and removed the line MYSQLCOM=-YES-)
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

相关文章

  • 1 Mac下MySQL安装卸载与配置

    1 Mac下MySQL安装卸载与配置 1 MySQL的安装、启动及卸载 1.1 MySQL的安装 安装brew: ...

  • Windows下MySQL安装

    MAC下MySQL下载、安装、卸载 下载MySQL MySQL下载地址:https://dev.mysql.com...

  • AndroidStudio Mac 下彻底卸载与安装总结

    AndroidStudio Mac 下彻底卸载与安装总结 (一)卸载 由于MAC拖拽的方式卸载不干净,导致每次重装...

  • Mac下mysql的安装与卸载

    使用homebrew安装mysql 1、安装mysql 2、启动mysql服务 3、设置root密码 设置验证密码...

  • Mac Mysql 基本操作命令

    心塞塞的用了各种方式在mac上 安装 卸载mysql,记录一下基本。 Mac Mysql 启动关闭和重启命令、重新...

  • Android速记

    Android Studio Mac 下卸载与安装 ADB工具 在 MAC OS X 安装 ADB (Androi...

  • Mac下彻底删除MysSQL

    Mac下mysql安装完成后,并没有卸载文件,只能自己卸载 首先需要停止mysql的有关进程然后逐一执行代码,彻底...

  • 在Mac OS X上怎么彻底卸载mysql

    在Mac OS X上怎么彻底卸载mysql 最近在 Mac下安装了mysql,好不容易装环境调试了一下午弄好了!在...

  • Mac mysql安装与卸载

    从搭建jira学习中摘出来mysql安装配置的相关内容,再附上卸载,方便查看,【踩坑】Mac搭建jira(数据库、...

  • Mac mysql的卸载与安装

    最近换了苹果电脑做开发,第一次接触mac安装开发环境很是蒙圈,百度了mysql安装方法,一不小心下了最新版本的my...

网友评论

      本文标题:Mac下mysql的安装与卸载

      本文链接:https://www.haomeiwen.com/subject/ceffdxtx.html