Hi all, On one of my Windows XP system I am unable to connect to mysql from php script. I am able to login to mysql server from the command line as well as mysql console provided by WAMP 2.0 but from php script mysql_connect() function is always failing. I have tested WAMP 2.0 and three versions of EasyPHP but in each case I am facing the same problem. Even phpMyAdmin is not being starting on this system. I have also followed the steps mentioned on the page http://forge.mysql.com/wiki/Error2003-CantConnectToMySQLServer but of no use. Can any one give me clue for reason behind this type of problem?
Best Regards ... Pankaj Kumar
On Thu, 2011-01-20 at 00:44 +0530, pankaj@glug4muz.org wrote:
On one of my Windows XP system I am unable to connect to mysql from php script. I am able to login to mysql server from the command line as well as mysql console provided by WAMP 2.0 but from php script mysql_connect() function is always failing. I have tested WAMP 2.0 and three versions of EasyPHP but in each case I am facing the same problem. Even phpMyAdmin is not being starting on this system. I have also followed the steps mentioned on the page http://forge.mysql.com/wiki/Error2003-CantConnectToMySQLServer but of no use. Can any one give me clue for reason behind this type of problem?
doubtful. but I can give you the solution: upgrade to linux
Try : http://www.apachefriends.org/en/xampp-windows.html
Sent from my Nexus S
On 02-Feb-2011, at 5:11 PM, "pankaj@glug4muz.org" pankaj@glug4muz.org wrote:
Hi all, On one of my Windows XP system I am unable to connect to mysql from php script. I am able to login to mysql server from the command line as well as mysql console provided by WAMP 2.0 but from php script mysql_connect() function is always failing. I have tested WAMP 2.0 and three versions of EasyPHP but in each case I am facing the same problem. Even phpMyAdmin is not being starting on this system. I have also followed the steps mentioned on the page http://forge.mysql.com/wiki/Error2003-CantConnectToMySQLServer but of no use. Can any one give me clue for reason behind this type of problem?
Best Regards ... Pankaj Kumar
2011/1/20 pankaj@glug4muz.org:
Hi all, On one of my Windows XP system I am unable to connect to mysql from php script. I am able to login to mysql server from the command line as well as mysql console provided by WAMP 2.0 but from php script mysql_connect() function is always failing. I have tested WAMP 2.0 and three versions of
How about some additional details like exact command line/PHP code snippet etc?
Usually this is a grant issue. Try:
GRANT SELECT ON mydatabase.* TO 'phpuser'@'phpserverip' IDENTIFIED BY 'phppassword';
and then in PHP:
mysql_connect($server, "phpuser", "phppassword");
Binand