Monday 26 December 2016

php - How to solve "Can't connect to local MySQL server through socket"

This is my config file:



$mysql_hostname = "localhost";
$mysql_user = "xyz";
$mysql_password = "abc";
$mysql_database = "mno";


$IT = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $IT) or die("Opps some thing went wrong");


Here is the warning that I get from it:




Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/03/10531303/html/iqamah.org/config.php on line 13





How can I fix this?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...