0

When connecting to the mysql server on my localhost via an iisexpress server I get the following error:

iisexpress.exe Error: 0 : Host 'MyPcName' is not allowed to connect to this MySQL server

But the problem is it only happens to certain connections and there is no real difference between the connection or/and task.

Is this a problem of mysql or of iisexpress? And how do I know what it is and fix it?

I'm using MySQL Connector Net 6.7.4 ,Visual Studio 2013 and XAMPP 1.8.2.

Stéphane
  • 11,755
  • 7
  • 49
  • 63

1 Answers1

1

Taken from the 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.

Sergi
  • 579
  • 3
  • 14