Tuss Posted June 1, 2008 Share Posted June 1, 2008 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/true-gangsters.mygamesonline.org/includes/db_connect.php on line 6 Can't connect to the MySQL server. Please contact the webmaster. Thats what it comes up with when i go to my site. Heres the code :- <?php session_start(); ob_start(); $connect = mysql_connect("localhost:330*","122***_trueg","TussR"); if($connect == TRUE) { if(mysql_select_db("122716_trueg") != TRUE) { exit("<span style='color: red'>Can't connect to the MySQL database. Please contact the webmaster.</body></html>"); } }else{ exit("<span style='color: red'>Can't connect to the MySQL server. Please contact the webmaster.</body></html>"); } ?> Link to comment https://forums.phpfreaks.com/topic/108251-warning-mysql_connect-cant-connect-to-local-mysql-server-through-socket/ Share on other sites More sharing options...
timmah1 Posted June 1, 2008 Share Posted June 1, 2008 try this $dbhost = "localhost:330*"; $dbuser = "122***_trueg"; $dbpassword = "TussR"; $dbdatabase = "122716_trueg"; $db = mysql_connect($dbhost, $dbuser, $dbpassword); mysql_select_db($dbdatabase, $db); Link to comment https://forums.phpfreaks.com/topic/108251-warning-mysql_connect-cant-connect-to-local-mysql-server-through-socket/#findComment-554911 Share on other sites More sharing options...
.josh Posted June 1, 2008 Share Posted June 1, 2008 You already posted this question here: http://www.phpfreaks.com/forums/index.php/topic,199885.msg903133.html#msg903133 It was moved to the 3rd party forum because it's a 3rd party script. Please do not make multiple threads asking the same thing. Thread closed. Link to comment https://forums.phpfreaks.com/topic/108251-warning-mysql_connect-cant-connect-to-local-mysql-server-through-socket/#findComment-554913 Share on other sites More sharing options...
Recommended Posts