第一步:更改配置文件
在连接数据库的时候将localhost换为服务器ip即可
还不能解决
查看用户名和密码时候正确
在MySQL 5.66版本之后,mysql库中的user表的password字段替换为了authentication_string
结果为MD5加密文本,可以来这个网址解密,类型选择mysql5:https://www.cmd5.com/default.aspx?hashtype=md5&answer=cWluZ21pbmcxMTI0MTUu
use mysql;
select User,host,authentication_string from user; #此处为查询用户命令
update mysql.user set authentication_string=password('*******') where user='*******'; #数字加不加引号无关紧要
FLUSH PRIVILEGES;