|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-21 07:40 UTC] sniper@php.net
[2004-12-21 13:49 UTC] bc at default dot co dot yu
[2004-12-21 14:38 UTC] bc at default dot co dot yu
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Description: ------------ I'm using recent 4.3.10 release with mysql 4.1 client libs. I have a configuration of 2 servers. One is the MySQL database, another is apache 1.3 running PHP 4.3.10 through CGI/FastCGI interface. All scripts are using "localhost" value in mysql_connect() function. Actually that connection is being NAT'ed with iptables to MySQL server. When I do manual connect with telnet to localhost:3306 it works fine. Also if "localhost" is changed to "127.0.0.1" or direct IP of MySQL host ( 10.1.5.55 in this case ) it just works fine! *But* when is "localhost" in mysql_connect() it simply does NOT work! Reproduce code: --------------- I keep getting this: Access denied for user: 'username@10.1.5.89' (Using password: NO) keep in mind that I *am* providing the password: $db = mysql_connect("localhost", "$db_username", $db_password); this is my /etc/hosts file: 127.0.0.1 localhost localhost.localdomain BTW, I've tried all the combinations: 127.0.0.1 localhost or: 127.0.0.1 localhost.localdomain