命令: use mysql;
insert into user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values("localhost","chen",password("1234"),"","","");
flush privileges;
记得要刷新系统权限表,否则无法登陆
或者使用命令:grant all on *.* to chen@'localhost' identified by '1234';
更改密码
update mysql.user set Password=password("newpasswd") where User="chen" and Host="localhost";
flush privileges;