一、可以成功登录到MySQL中
1 使用具有数据库管理权限的用户登陆MySQL,如root用户
$ mysql -uroot -p'root_password'
2 在mysql中创建用户名和密码
mysql> create user 'new_username'@'%' IDENTIFIED BY 'new_password';
3 配置权限
mysql> grant all privileges on *.* TO 'new_username'@'%' with grant option;
4 提交并立即生效
mysql> commit;
mysql> flush privileges;
5 退出mysql
mysql> quit
完成
二、不能登录到MySQL中
1 执行vim /etc/my.cnf命令
2 屏蔽default_authentication_plugin=mysql_native_password语句
3 添加skip-grant-tables(跳过密码验证)