mysql8手贱不小心改了user表的host,搞得自己的本机也连接不上mysql8

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
回答: 当出现MySQL连接不上错误"Host is not allowed to connect to this MySQL server"时,有几种可能的解决方法。首先,可以尝试使用改法来解决。在localhost的电脑上登录MySQL,然后在"mysql"数据库的"user"中将"host"项从"localhost"改为"%"。这样可以允许远程登录。\[1\] 另外一种解决方法是通过阿里云打开3306端口。如果你在阿里云部署的服务器和MySQL,需要在阿里云的安全组中添加3306端口。这样可以允许远程访问MySQL。\[2\] 此外,还可以在数据库的配置中设置允许远程登录。通过登录阿里云的SSH,并登录数据库,使用MySQL数据库,将root用户的host字段改为%,默认情况下是localhost,只能本地连接,改为%后就可以远程连接了。然后刷新权限,即可实现远程访问。\[2\] 总结起来,解决MySQL连接不上错误"Host is not allowed to connect to this MySQL server"的方法包括改法、打开3306端口和修改数据库配置。根据具体情况选择适合的方法进行解决。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* [远程连接MYSQL提示Host is not allowed to connect to this MySQL server](https://blog.csdn.net/EI__Nino/article/details/25069391)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [数据库mysql无法远程访问,出现Host is not allowed to connect to this MySQL server解决办法](https://blog.csdn.net/nhx900317/article/details/128001567)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [连接MySQL出现Host is not allowed to connect to this MySQL server 解决方法](https://blog.csdn.net/arlene12345/article/details/122933316)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值