sudo mysql -uroot -p
#使用sudo之后mysql密码为空即可登陆
update user set authentication_string='' where user='root';
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
标签:Mysql,sudo,密码,user,mysql,root
From: https://www.cnblogs.com/vv3b/p/17023332.html