问题描述
当我尝试连接putty我得到'主机是不允许连接到这个mysql服务器'。为什么会发生?主机和客户端都在我的机器上。
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.
推荐答案
您需要更改配置的设置。
You need to change how your configuration is set up.
注释掉您的MySQL配置中的skip-networking部分:#skip-networking
c $ c> skip-networking 它会丢弃任何TCP / IP连接,这可能是为什么你的失败。
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.
一旦您启用了TCP / IP连接,您将需要授予您的用户从其他计算机连接的权限:
Once you have enabled your TCP/IP connections you will need to grant permission to your user to connect from other machines:
授予所有权限*。* TO< username> @'%'IDENTIFIED BY'< password>';
这将允许用户使用适当的密码从任何机器连接到数据库。
This will let username connect from any machine to your database with the appropriate password.
这篇关于在进行本地连接时,不允许主机连接到此mysql服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!