PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I want to connect to a mysql database remotely.
For instance,
I am connecting to mysql database server at 192.138.1.102 from my server say, 'myservername'
mysql_connect("192.138.1.102", user, pwd)
When I exceute this through my php page I cannot connect to the server.
It gives an error suggesting 'user@myservername' has no access to the database.
Have you got the permissions to access the database via an IP other than localhost? You need to make sure that your username has these permissions otherwise you will be denied access.
Is this your own database server or is it on a hosted machine?
What kind of permissions will I require?
I can access the database that is on 192.128.1.102 from the same machine with the help of user and password that I am passing to the function mysql_connect.