Hello All,
I cannot connect to mysql using PHP. I read another thread here on this site and tried the suggested code. But, no good for me.
I get the following error:
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
in /var/www/html/php/table1.php on line 5
The code that is being reported against is the following:
<?php
//list_db.php

$db=mysql_connect("mapes.thepumpkin.net","phpuser","phppass");
mysql_select_db("vermont",$db);
$result=mysql_query("select * from table",$db);

?>
I have made various changes to try and change the response, it never changes. I have been reading trying to find out about the mysql.sock file, not covered very much in the publication that I have.
Any help in getting the connection established would be greatly appreciated.

Thanks, Ron

    Try searching for mysql.sock on your server. When/if you find it, copy it to /var/lib/mysql. You should be able to connect.

    I had a similar problem when I first set up my server. A friend offered me the same advice, and it worked likke a champ.

    S. Stroz

      Write a Reply...