<?php
DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'sitename');
//make the connection
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySql: ' . mysql_error() );
//select the database
@mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
?>
i use this to make a connection and when i go to test to see if it works, i get this message:
Could not connect to MySql: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Any ideas why? Thank you for any help :D!
DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'sitename');
//make the connection
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySql: ' . mysql_error() );
//select the database
@mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
?>
i use this to make a connection and when i go to test to see if it works, i get this message:
Could not connect to MySql: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Any ideas why? Thank you for any help :D!






