有兩種安裝方式,一種是安裝包安裝,官網下載安裝包,mysql8.0下載、mysql5.7安裝;html
這裏記錄brew安裝:java
1.brew uninstall mysql 卸載原有的;mysql
2.brew install mysqlsql
3.可經過brew info mysql 查看 mysql相關,有兩種啓動方式,mysql.service start / brew services start mysql;ui
4.mysql -uroot 進入,並修改密碼,ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';(5.7以後引入mysq_sercuity).net
5.因密碼過短,可查看和修改密碼驗證規則:code
show variables like 'validate_password%'; set global validate_password.length = 1;
(mysql版本間的參數名有差別,如5.7則爲validate_password_length)
set global validate_password.policy=LOW;
規則參考htm
數據清理blog
總結:get
1.mysql5.7與mysql8.0的版本差別有:某些參數名、數據目錄及類型、