mysql8初始化
sudo mysql_secure_installation
sudo mysql -uroot -p
use mysql
set global validate_password.policy=LOW;
update user set authentication_string='' where user='root';
update user set plugin="caching_sha2_password" where user='root';
update user set authentication_string=sha2("xxx",32) where user='root';
update user set Host='%' where User='root'; #远程登陆
alter user 'root'@'%' identified with mysql_native_password by 'xxxx';
flush privileges;
select user,plugin,authentication_string from user;