My site has been working pretty well during the past years. Then suddenly the following message just occured. What’s wrong?
Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)…on line 6
Here is the code it was referring to:
<?php
$dbservername = "localhost";
$dbusername = "myname";
$dbpassword = "mypassword";
$defaultdb = "mydb";
$cn = mysql_connect($dbservername,$dbusername,$dbpassword) or die("connection error ".mysql_error());
$db = mysql_select_db($defaultdb);
?>
:hair: