Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Hi alli am simply trying to connect to my database and getting an error that i cann't understand why this is.
Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/.sites/4/site38/web/whatever2.php on line 6
i have reduced the code to test the server connection only:
<?php
$username = "project3";
$password = "updatenews";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
// you're going to do lots more here soon
mysql_close($dbh);
?>
I have also made sure that the my.conf file in root>etc/ has the correct socket line it :
socket = var/lib/mysql/mysql.sock
so i really am stummped as to why the mysql is attemting to connect through tmp/mysql/mysql.sock.
anyone got any clue what i'm doing wrong?
regards
sticky