由于需要用到mysql,研究研究mac下mysql的安装,这里使用Homebrew安装方法
步骤
安装安装
brew install mysql
进入mysql
mysql -uroot
进入成功:
由于mysql的默认密码是级别很高的一串,所以一般都要修改成自己设置的密码
设置密码时一般会出现以下错误:
Your password does not satisfy the current policy requirements
出现这个问题的原因是:密码过于简单。刚安装的mysql的密码默认强度是最高的,如果想要设置简单的密码就要修改validate_password_policy的值,
validate_password_policy有以下取值:
Policy | Tests Performed |
---|---|
0 or LOW | Length |
1 or MEDIUM | Length; numeric, lowercase/uppercase, and special characters |
2 or STRONG | Length; numeric, lowercase/uppercase, and special characters; dictionary file |
修改密码
修改上面提到的validate_password_policy值:
如果要修改这个值,
登入到mysql
- 设置新密码
2、设置安全级别
3、默认密码长度为8,可以设置为其它值,最小4位
4 设置新的密码