Hi, newbie question, I am trying to connect to a godaddy mysql with a third party script as follows function Db($db_host="mysqlname", $db_user="User", $db_password = "Password", $db_name = "Name", $db_pconnect = 0) { $connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect"; if (!$this->connection = $connect_handle($db_host, $db_user, $db_password)) { $this->error("Could not connect to the database server ($db_host, $db_user).", 1); } PHP: But it is giving me the knockback with error Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/s/h/a/name/html/includes/db_mysql.php on line 39 PHP: An unexpected error occured. Please try again later. Can anyone help?
What is the mysqlname set to? Godaddy is the exception to use "localhost". You have to go into their control panel under databases >mysql>Click the edit button. The hostname will be listed 2nd: Host Name: p14mysql532.secureserver.net And you have to check it per database, even if they are the same acct, godaddy will put them on different mysql servers.
the name is the same as you listed - I knew to remove localhost. I just replaced it with name cos I didn't know if it was account specific or generic
Most webhosts you just use localhost and it works. Godaddy's just a pain about it. Getting the hostname from the ctrl panel should fix your problem though.
I have logged a ticket - presumably, they will just send a link to the godaddy mysql help page (which I have looked at)
No joy from the ticket - before I post a job on the job board - does anyone want to bid for fixing it (paid)