Hello
I have a website where i have used php and mysql,till now both php and mysql were located in same server and my site was working fine but recently we have shifted Mysql to a different server.
In the php code we have changed the server name with the new server name.but when we try to open the page we are getting error
THE ERROR IS
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/web/XXXXX/STONEDIVER_PHP_LIBRARY/source/shared/database.php on line 38
Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
The code before migration of Mysql was
$server = "localhost";
$dbname = "database";
$user = "username"; //Allowed for the ip
$password = "password";
$link = mysql_connect($server,$user,$password) or die(mysql_error());
mysql_select_db($dbname);
The code after migrating Mysql is
$server = "serverip/servername";
$dbname = "database";
$user = "username"; //Allowed for the ip
$password = "password";
$link = mysql_connect($server,$user,$password) or die(mysql_error());
mysql_select_db($dbname);
I have tried using both server IP and server name...
Please help me out in solving this problem...
THANKS IN ADVANCE