not allowed to connect

A

Anonymous

Guest
Hi,
I have two machines:
1. betelgeuse.cis.ksu.edu: it is a linux on which my apache server is running.
2. procyon.cis.ksu.edu: it is a solaris on which my mysql server is running.
I have written a samll php script which connects to the mysql server. But I get following errors when my script is executed. But the other scripts which do not require database access are working fine.

Warning: Host 'betelgeuse.cis.ksu.edu' is not allowed to connect to this MySQL server in /amd/keid/root/cis/keid/home/grads/deepak/.html/table.php on line 5

Warning: MySQL Connection Failed: Host 'betelgeuse.cis.ksu.edu' is not allowed to connect to this MySQL server in /amd/keid/root/cis/keid/home/grads/deepak/.html/table.php on line 5
Host 'betelgeuse.cis.ksu.edu' is not allowed to connect to this MySQL serverUnable to connect to the host

Can anybody shed light on this?

with regards,
RN
 
For security reasons, MySQL defaults to only allowing users to access a database from localhost. In order to add priveledges for a user to connect from a different host, you must use GRANT. See the documentation for the GRANT and REVOKE Syntax. Since the documentation isn't terribly clear, here's the important paragraphs:

In order to accommodate granting rights to users from arbitrary hosts, MySQL supports specifying the user_name value in the form user@host. If you want to specify a user string containing special characters (such as `-'), or a host string containing special characters or wildcard characters (such as `%'), you can quote the user or host name (for example, 'test-user'@'test-hostname').

You can specify wildcards in the hostname. For example, user@'%.loc.gov' applies to user for any host in the loc.gov domain, and user@'144.155.166.%' applies to user for any host in the 144.155.166 class C subnet.
 
Back
Top