smartflower2002 Posted June 15, 2010 Share Posted June 15, 2010 hey guys first i would like to tell u something about myself and my comp, i am on windows 7 x64, and i am a php coder, and i am ready to do anything for my below issue.. 1) i downloaded and installed apache from apache.org and its working like a charm. 2) i downloaded the complete x64 mysql installer from here, and installed, no error nothing. that tooo works like charm. 3) i downloaded and installed php vc6 safe thread zip and configured apache to work with it.. now that too works like a charm. now the issue, i enabled mysql.dll and mysqli.dll in php.ini and checked in phpinfo() and i can see both the extenstions are enabled. so i made a short test script like mysql_connect("localhost", "root", "******") or die(mysql_error()); echo("it works"); and i ran it, i get a blank white screen after many seconds.. then i ran phpmyadmin, and tried to log in into it, same error. i verified the mysql server is running, and i tried to log into it using console and passed. so can anyone tell me what is the issue? i did one check myself, i turned off mysql server manually, and re-ran both, myscript and phpmyadmin, same error, so my best guess is php cannot communicate with mysql.. can u pleaes please help me, i need this badly Quote Link to comment https://forums.phpfreaks.com/topic/204830-php-cannot-connect-with-mysql/ Share on other sites More sharing options...
myrddinwylt Posted July 10, 2010 Share Posted July 10, 2010 I just encountered this problem myself. Also, no one responded to my post either, but I was able to resolve it. The problem is that the newer versions of PHP went dumb and can't figure out that "localhost" equals "127.0.0.1". Use 127.0.0.1 instead of localhost and you will have no problems (providing the correct credentials, server is started, etc etc.) Cheers. (ps: hope they stop "fixing" shit that ain't broke over at the php dev crew, and maybe release proper instructions on how to compile under windows and provide ALL the libraries included necessary to compile in the source they distro rather than leaving it up to people to randomly figure out (hopelessly) where they go). Quote Link to comment https://forums.phpfreaks.com/topic/204830-php-cannot-connect-with-mysql/#findComment-1084241 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.