Jump to content

mySQL situation - moved to a new hosting company


npsari

Recommended Posts

I moved to a different hosting company

 

and now, all my mySQL connections are failing

 

I dont know why!!!  the username and password are the same

 

I always get this message:

 

Could not connect: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46)

 

Do you know what is going on

Can you post your code?  Are you using "localhost".  What kind of server was your old hosting company and what is it now?  For example:  Unix, Linux, Windows.  The error seems to be that the default socket path is different.  I would contact your host about this, unless you have telnet/ssh knowledge and access.  

Ohh, really?

 

So, Does that mean this code will not work...

 

$con = mysql_connect("localhost","name","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("database", $con);

 

because this is what I am using with my pages

See, you have localhost.  Your new host provider might not have localhost as a valid mysql database host. It might be a subdomain like i showed you above. Read the emails you got on signup. They should explain it. If you  have cpanel, click the MySQL icon and it shows you the database host url. If all else fails, contact support and ask them.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.