Host is not allowed to connect to this mysql server when making a local connection [closed]

隐身守侯 提交于 2019-11-29 21:24:41

问题


When I try to connect with putty I get 'host is not allowed to connect to this mysql server'. Why is that happening? Host and client are on my machine.

When I connect with the command line it connects.


回答1:


You need to change how your configuration is set up.

Comment out the skip-networking section within your MySQL config: # skip-networking, if you have skip-networking it will discard any TCP/IP connection which is likely why your failing.

Once you have enabled your TCP/IP connections you will need to grant permission to your user to connect from other machines:

GRANT ALL PRIVILEGES ON *.* TO <username>@'%' IDENTIFIED BY '<password>';

This will let username connect from any machine to your database with the appropriate password.



来源:https://stackoverflow.com/questions/13731514/host-is-not-allowed-to-connect-to-this-mysql-server-when-making-a-local-connecti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!