Page 1 of 1

MySQL so called ERROR 2002 aka Can't connect to local MySQL

Posted: Fri Dec 31, 2010 10:54 am
by hadlawp
hi guys, i would really appreciate if anyone could help me figure out why im getting this error

i called godaddy and they said nothing is wrong with their servers,
the thing that surprises me the most is that i have been basically coping and pasting these access string all the time, and why all of the sudden just this instance doesnt work

heres the full error:

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/37/6293537/html/207math/content/post.php on line 127

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/37/6293537/html/207math/content/post.php on line 127
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


and here is the corresponding code

Code: Select all

$result1 = mysql_connect(***correct info***) or die(mysql_error());
$result2 = mysql_select_db(***correct info***) or die(mysql_error());
(line 126)$insert = "INSERT INTO forums (author, postLocation, inReplyToPostId, content, status) VALUES ('".$username."', '".$classbegin."', '".$id."', '".$replyId."', '".$content."', '".$status."')";
(line 127)$insert1 = mysql_query($insert) or die(mysql_error());
    
mysql_close($result1);

Re: MySQL so called ERROR 2002 aka Can't connect to local My

Posted: Fri Dec 31, 2010 5:52 pm
by DigitalMind
Are you sure /var/lib/mysql/mysql.sock exists?