How to Block Unauthorised MySQL Connections

This error is good when a host other than the allowed ones connect.

"Host <<hostname>> is not allowed to connect to this MySQL server"

This page helps you whether you want to solve the above problem or cause the above problems for those unauthorised entities that wish to gatecrash your MySQL party.

How to Block Unauthorised MySQL Connections

The error means that there is no row in the MySQL user table with a hostname value that matches the client attempting to connect.

Host … is not allowed to connect to this MySQL server

How to Block Unwanted (or Unblock Wanted) Connections

Set 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.

Important – Change the Percent Symbol

Otherwise, your system will be left insecure because it permits connections from any host for the given user name.

Leave a Reply

Your email address will not be published. Required fields are marked *