MySQL Forums
Forum List  »  PHP

Re: #1130 - Host 'localhost' is not allowed to connect to this MySQL server
Posted by: jink
Date: January 11, 2007 03:51PM

mysql documentation and specifically, "5.8. The MySQL Access Privilege System" section contains the information on how to do this.

mysql basically authentics users based on host & userid. hence, if a particular user is not specified in the mysql.user table to be connecting from a specific host, then the connection request (be it odbc, mysql, etc) will be rejected.

hence, the solution is to add an entry (or entries) for all accesses ( host & user combination). if there is a need to have user "root" access the db from "host1.com", "host2.com", and "host3.com"... then there must be 3 entries or an entry with matching pattern.

e.g.
select host, user from mysql.user

+-----------+------+
| host | user |
+-----------+------+
| host1.com | root |
| host2.com | root |
| host3.com | root |
+-----------+------+

or

+-----------+------+
| host | user |
+-----------+------+
| host% | root |
+-----------+------+

please note that you need to use the ID or the name which is being used for the host name when mysql connection is requested.

"ERROR 1130 (00000): Host 'Host1.com' is not allowed to connect to this MySQL server."

ip address is not necessarily interchangable with FQDN or host name. so use the exact NAME which is displayed with the error.

additionally after the change (modifying the mysql.user table) you MUST shutdown/restart the mysql server or using mysqladmin.exe do "reload" to update the necessary system tables.

-jin

Options: ReplyQuote


Subject
Written By
Posted
Re: #1130 - Host 'localhost' is not allowed to connect to this MySQL server
January 11, 2007 03:51PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.