1 查看初始密码
cat /var/log/mysqld.log|grep 'A temporary password'
2 修改密码
alter user 'root'@'%' identified by 'xxxx';
问题:Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
grant system_user on *.* to 'root';
问题:
Authentication plugin ‘caching_sha2_password’ cannot be loaded…
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mypwd#2018';
3最后执行
flush privileges;