[CLUE-Tech] MySQL + PHP 4.2 --> localhost.localdomain cannot connect?

Jeffery Cann fabian at jefferycann.com
Mon Apr 29 18:39:26 MDT 2002


Greetings.

I upgraded to PHP 4.2.0,  statically linked into apache.  When I try to 
connect to a MySQL database via a PHP script, PHP replies:

    Warning: Host 'localhost.localdomain' is not allowed to connect 
    to this MySQL server ...

Isn't that interesting?

mysql> select host, user from user;
+-----------+---------+
| host      | user    |
+-----------+---------+
| localhost | phpesp  |
+-----------+---------+

I was running PHP 4.0.0 and this script connected with MySQL, ran statements, 
etc.  Nothing on the MySQL side changed.  The PHP script passes 'localhost' 
for the host name to the MySQL connection.  

   $db = mysql_connect('localhost','phpesp','php134esp');

Nothing turned up on Google except a thread in the Zend/Development list  -- 
someone observed the same behaviour, but no causes or workarounds were 
reported.

On a lark, I changed the HOST column for this user from 'localhost' to 
'localhost.localdomain' to no avail -- this doesn't work even via the 'mysql' 
command line.

mysql> select host, user from user;
+-----------------------+---------+
| host                  | user    |
+-----------------------+---------+
| localhost.localdomain | phpesp  |
+-----------------------+---------+

Next, I updated the db table for the 'phpesp' database:

mysql> select host,db from db;
+-----------------------+------------+
| host                  | db         |
+-----------------------+------------+
| localhost.localdomain | phpesp     |
+-----------------------+------------+

Still denied!  I am stumped and appreciate any suggestions.

Gracias,
Jeff



More information about the clue-tech mailing list