Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

PHP connection to mySQL

I have setup a PHP /MySQL in my  internal network. The server can be access through a IP http://10.1.3.3. I can also access to MySQL using mySQL Workbench installed in my PC.

In my PHP statement, if replace the server "localhost" with the actual IP address, the php page can't connect and return with a error :

Any idea why does it happen ?

Connection error: Can't connect to MySQL server on '10.1.3.3' (4)

Thx
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes.
Root@localhost is not the same as root@%
It depends on which rights you grant to the root@%
Though usually it is best to use a separate dedicate account for the php application that has a limited scope and can only access specific databases.