Should have added; You don't have to GRANT ALL, obviously you can assign
permissions as required so you could just do GRANT SELECT, UPDATE if that is
all that is required.

-----Original Message-----
Sent: 13 February 2003 13:20
Subject: [PHP-DB] MySQL problem -- new to PHP

Hi all

I am new to PHP (just basically started yesterday). I am currently having a
problem connecting to a MySQL database.

My sample code is:

mysql_connect(localhost,"username","password") or die ("Unable to connect to
MySQL server.");
$db = mysql_select_db("DB_NAME") or die ("Unable to select requested

This throws the following error:

Warning: MySQL Connection Failed: Host '' is not allowed to
connect to this MySQL server

Now, the mySQL server and the web server reside on the same machine. This
warning is therefore saying that this machine does not have permission to
connect to itself. Hmm. I have put entries in the host table and the user
table, using both hostname and ip address, but no luck. I keep getting the
same error.

What am I doing wrong?

Any and all help appreciated.


Evan Morris
+27 11 792 2777 (tel)
+27 11 792 2711 (fax)

PHP Database Mailing List (
To unsubscribe, visit:

This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to