Page 1 of 1

error in connection between mysql and php

Posted: Mon Nov 14, 2011 12:54 pm
by amirbwb
Hello, I have created a software on my localhost ... but i uploaded it to my friend server, it shows me an error:


Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /hermes/bosweb25c/b1151/nf.lebanonline/public_html/medi-school-net/emp/medcon/medcon.php on line 6

Fatal error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /hermes/bosweb25c/b1151/nf.lebanonline/public_html/medi-school-net/emp/medcon/medcon.php on line 6

medcon.php (the connection to mysql)

Code: Select all

<?php
$hostname_connection = "localhost";
$database_connection = "***************";
$username_connection = "**********";
$password_connection = "************";
$connection = mysql_pconnect($hostname_connection, $username_connection, $password_connection) or trigger_error(mysql_error(),E_USER_ERROR);
?>
************** for privacy only =)


why it is giving me this error ???? it worked fine on my localhost and my free domain at amir.comoj.com/najla

Re: error in connection between mysql and php

Posted: Mon Nov 14, 2011 3:25 pm
by social_experiment

Re: error in connection between mysql and php

Posted: Mon Nov 14, 2011 5:08 pm
by amirbwb
thank you but am searching for sock(2) not sock(38) ... and my friend is hosting with a company he have no access to directories in server, only he can upload to public/
so should he contact the company or what to do ?

Re: error in connection between mysql and php

Posted: Tue Nov 15, 2011 12:33 am
by social_experiment
amirbwb wrote:so should he contact the company
Yeah. If neither of you have any experience with running webservers or don't run the webserver yourself it's best to ask whoever is hosting your site.

Re: error in connection between mysql and php

Posted: Tue Nov 15, 2011 4:12 pm
by amirbwb
mm ok thank you very much ... I will