not allowed to connect

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: macek, egami, gesf

Post Reply

not allowed to connect

Post by ramnarayan » Sat Jul 19, 2003 9:27 am

I have two machines:
1. it is a linux on which my apache server is running.
2. 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 '' 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 '' 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 '' is not allowed to connect to this MySQL serverUnable to connect to the host

Can anybody shed light on this?

with regards,

User avatar
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Post by swirlee » Sat Jul 19, 2003 12:20 pm

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@'' applies to user for any host in the domain, and user@'144.155.166.%' applies to user for any host in the 144.155.166 class C subnet.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest