I have this error:
Warning: mysql_connect(): [2002] Connection refused (trying to connect via tcp:
I saw a similar question, and I tried the solution by changing localhost to 127.0.0.1 , but it still does not work. I am using Mac OS X Lion. Please any help would be appreciated
This is the PHP code that I use to connect:
<?php require("constants.php"); //open database $connect = mysql_connect(DB_SERVER,DB_USER,DB_PASS) or die('error connecting: ' . mysql_error()); mysql_select_db(DB_NAME)or die('error selecting db: ' . mysql_error());//select database ?>
source share