[日常] 解决mysql localhost可以连接但是127.0.0.1不能连接

在测试mysql的过程中遇到使用localhost可以连接但是127.0.0.1不能连接,原因是localhost使用的本地socket连接,127.0.0.1使用使用的tcp连接

在mysql库的user表中,root账号默认的加密验证方式是auth_socket是,从新使用新的方式生成一下密码加密就可以了

可以更改下用户的加密方式:
update user set authentication_string=password("123456"),plugin='mysql_native_password' where user='root';

posted @ 2019-12-06 23:57  唯一客服系统开发笔记  阅读(7851)  评论(0编辑  收藏  举报