views:

299

answers:

3

i install windows7 ultimate and php 5.3.1 and mysql server 5.1

mysql server work fine from

                  mysql>

and if see phpinfo();

i get the following table

              mysql
       MySQL Support enabled 
      Active Persistent Links  0  
      Active Links  0  
      Client API version  mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $  
      Persistent cache enabled 
      put_hits  0  
      put_misses  0  
      get_hits  0  
      get_misses  0  
      size  2000  
       free_items  2000  
      references  2  

but when i connect with following php command

   $db_host="localhost"; 
   $db_name="mysql";
   $db_user="root";
   $db_pass="*****"; 

   $dbc=mysql_connect($db_host,$db_user,$db_pass) OR DIE (mysql_error());
   $dbs=mysql_select_db($db_name) OR DIE (mysql_error());

when i run page, page take long time in loading and then return nothing. and if i pass any query it return false, i think its connection problem.

Thanks

A: 

You should try to connect using pure php.exe, not web server. What error message is shown? Also maybe try '127.0.0.1' intsead of 'localhost'

noonex
+2  A: 

Yes, use 127.0.0.1 instead of localhost. Alternatively you can disable IPv6 or disable the IPv6 localhost alias in your HOSTS file.

Pierre
its working fine with 127.0.0.1 why not working with localhost...?
air
A: 

i have installed mysql on windows 7 ultimate ... i'm having somewhat similar issue ... I'am unable to make concurrent connection to mysql using 2 different clients ... i.e. if I connect through mysql command line client it gets connected if I open one more command line client and try to connect through it hangs after entering password .. as soon as I close the 1st client 2nd one gets connected.

Hussain