解决方案:
mysql -uroot -p use mysql; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';
mysql -uroot -p
use mysql; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';
参考:https://www.whatled.com/post-6429.html