Board index   FAQ   Search  
Register  Login
Board index php forum :: Database phpMyAdmin

not allowed to connect

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

Moderators: macek, egami, gesf

not allowed to connect

Postby ramnarayan » Sat Jul 19, 2003 9:27 am

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
ramnarayan
 

Postby 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@'%.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.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron