当通过 iisexpress 服务器连接到本地主机上的 mysql 服务器时,出现以下错误:
iisexpress.exe Error: 0 : Host 'MyPcName' is not allowed to connect to this MySQL server
但问题是它只发生在某些连接上,并且连接或/和任务之间没有真正的区别。
这是mysql的问题还是iisexpress的问题?我如何知道它是什么并修复它?
我正在使用 MySQL Connector Net 6.7.4、Visual Studio 2013 和 XAMPP 1.8.2。
最佳答案
取自 reference manual :
f the following error occurs when you try to connect from a host other than the one on which the MySQL server is running, it means that there is no row in the user table with a Host value that matches the client host:
Host ... is not allowed to connect to this MySQL server
You can fix this by setting up an account for the combination of client host name and user name that you are using when trying to connect.
If you do not know the IP address or host name of the machine from which you are connecting, you should put a row with '%' as the Host column value in the user table. After trying to connect from the client machine, use a SELECT USER() query to see how you really did connect. Then change the '%' in the user table row to the actual host name that shows up in the log. Otherwise, your system is left insecure because it permits connections from any host for the given user name.
关于mysql - 不允许通过 IISExpress 连接到 Mysql 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21017966/