by sergioag » Mon Jan 31, 2005 2:36 pm
Hi
There are two ways of connecting to a mysql server:
- TCP/IP: as you said that's using port 3306. Some hostings have this turned of because of security reasons (to avoid someone out of their network access the database). This can be used in both Unix and Windows.
- Unix socket: this is the usual choice of you're running a mysql server on a unix machine (say, linux for example). It works with a unix socket at (by default, if i remember correctly) /tmp/mysock.sock. I have only used this when the mysql server is in the same machine as apache itself. To use this way you should specify "localhost" as the "host" parameter in the mysql_connect() function.
If connecting via tcp/ip is not working, and your server is a unix one you should try the second one.
Hope this works.
Sergio