Unanswered: Getting php to connect to database using 127.0.0.1
What does it take to get php to connect to local mysql/mssql server using 127.0.0.1? I am not able to use mysql_connect() or mssql_connect() using this ip.
Can any one please point me to some links or help me in accomplishing the same? One point worth noting here is that, am able to use this local loop ip at workplace when am connected to the intranet.
The moment I go out of the network, the mssql/mysql access is also denied for me. At home, I use an isp which overrides my local loop address. Only if I disconnect the internet connection, I am able to use "localhost". Even in this case, I am not able to use "127.0.0.1".
First of all the [user you use]@localhost/127.0.0.1 has the permissions to "see" the mysql?
If you are at a intranet, I think you have to put your ip adress for this network .
At first if you use "localhost" you must not have problems, is not it?
Yes. The user does have permissions. When am at work place, I use 127.0.0.1 to connect to mysql/mssql. But when am out of network am not able to use this ip. I would like to know how this is possible since its supposed to work either in/out of the network.
Are you trying to connect to the database on one machine from a different one?
If this is the case, you must set up a user for the machine from which you are connecting. ie. if you're using your home computer then you must have a user 'username@homeipaddress' set up to use the mysql server. 127.0.0.1 is a loopback network connection. It is essentially the same as using localhost. Your machine's ip address is not 127.0.0.1, nobody's is.