471,090 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,090 software developers and data experts.

connection/permission problem

I have the following sitution...

MySQL version 3.23.47
PHP version 4.3.2
Redhat Linux version 7.1
Apache version 1.3.29

I have a MySQL user called 'user' that is set up with full rights for
localhost, 127.0.0.1, and the external IP address.

I can connect to the database using all three users from the command line...
../mysql --user=user --password=password --host=###.###.##.###
../mysql --user=user --password=password --host=127.0.0.1
../mysql --user=user --password=password --host=localhost

But in my php script running on the server, I can only connect using the
hostname localhost...
$DBConnection = mysql_connect("localhost","user","password");

the IP addresses don't work...
$DBConnection = mysql_connect("###.###.##.###","user","password");
$DBConnection = mysql_connect("127.0.0.1","user","password");

these give me the following error:
Warning: mysql_connect(): Can't connect to MySQL server on 'domain.com'
(111)

Is there anyone that's seen this and can point me in the right direction?

Thanks.
Jul 20 '05 #1
1 1287
I feel like quite the idiot... I specified the port # in the connection and
it works when using an IP address. Any insight into why localhost doesn't
need a port number, but an IP address does?

thanks.

"Bob Garbados" <bo*********@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
I have the following sitution...

MySQL version 3.23.47
PHP version 4.3.2
Redhat Linux version 7.1
Apache version 1.3.29

I have a MySQL user called 'user' that is set up with full rights for
localhost, 127.0.0.1, and the external IP address.

I can connect to the database using all three users from the command line... ./mysql --user=user --password=password --host=###.###.##.###
./mysql --user=user --password=password --host=127.0.0.1
./mysql --user=user --password=password --host=localhost

But in my php script running on the server, I can only connect using the
hostname localhost...
$DBConnection = mysql_connect("localhost","user","password");

the IP addresses don't work...
$DBConnection = mysql_connect("###.###.##.###","user","password");
$DBConnection = mysql_connect("127.0.0.1","user","password");

these give me the following error:
Warning: mysql_connect(): Can't connect to MySQL server on 'domain.com'
(111)

Is there anyone that's seen this and can point me in the right direction?

Thanks.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by SerGioGio | last post: by
6 posts views Thread by RML | last post: by
18 posts views Thread by WStoreyII | last post: by
5 posts views Thread by Burton Roberts | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.