i have following script in php to login to mysql
$db_host="localhost";
$db_user="root";
$db_pass="123";
$dbc=mysql_connect($db_host,$db_user,$db_pass) OR DIE (mysql_error());
$dbs=mysql_select_db($db_name) OR DIE (mysql_error());
this script was working fine, now i reinstall the O.S now i have windows 7 and iis7 and PHP Version 5.3.2 & mysql server 5.1 but now this script is not working and taking log time to execute.
Thanks
On Windows 7 localhost
resolves to ::1
, and MySQL doesn't support IPv6 as far as I know.
Connecting directly to 127.0.0.1
resolves this problem; but you can edit the hosts
file to resolve localhost
to 127.0.0.1
, then localhost
will work too:
::1 localhost
127.0.0.1 localhost
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With