Mysql安装后root无法登陆(Access denied for user 'root'@'localhost')

复杂密码才能通过

sudo mysql -u root -p
mysql> select user, plugin from mysql.user;
mysql> update mysql.user set authentication_string=PASSWORD('xcvds_32GDS'), plugin='mysql_native_password' where user='root';

mysql8.0不能用上边的语句:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY "svewe_123";

原文地址:https://www.cnblogs.com/wanshiming/p/13066455.html