PHP/MySQL Access Denied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Everybody's favorite problem but this one is strange. I can connect to my mysql 4.1.7 database fine from the command line, but php won't connect no matter what I try, I always get the same error.

Here is the script

<?php
$link =  mysql_connect("localhost:3306", "xoops", "notmypassword"  );

/* check connection */
if (!$link) {
   printf("Connect failed: %s\n", mysql_error());
   exit();
}

/* close connection */
$mysql->close();
?>

This is what I get, doesn't matter what username/password I use, or whether I use a socket or TCP/IP to connect.

Access denied for user 'root'@'localhost' (using password: NO)


I find it annoying that it insists I am trying to connect as root with no password, when that is not the case. I know about the 4.1 password issues and that should not have anything to do with this error. It also does this if I set the passwords to NULL in the script and database.

Anyone have any help for me?

Tod Schmidt
System Administrator
The Nature Conservancy
tschmidt@xxxxxxx
(703) 841-2028 (Phone)
(703) 276-0713 (Fax)
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux