本文为博主原创,若转载请注名出处。
在Mac上安装homebrew(官网安装教程)
homebrew依赖:Command Line Tools (CLT) for Xcode或者Xcode这两者 的安装就不细说了在准备好以上工具后在terminal输入:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
关于使用homebrew的使用在这里不做介绍
确认安装成功
在terminal输入:
brew doctor
使用homebrew安装mysql
在terminal输入:
brew install mysql
homebrew的配置
使用mysql的配置脚 本:/usr/local/opt/mysql/bin/mysql_secure_installation 启动这个脚本后,即可根据如下命令提示进行初始化设置(在这之前先启动mysql服务)
sunyichaodeMacBook-Pro:~ sunyichao$ /usr/local/opt/mysql/bin/mysql_secure_installation //mysql 提供的配置向导
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD PLUGIN can be used to test passwordsand 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: k //是否采用mysql密码安全检测插件(这里作为演示选择否,密码检查插件要求密码复杂程度高,大小写字母+数字+字符等)
Please set the password for root here. // 首次使用自带配置脚本,设置root密码
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 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.