I am trying to move a guest book to another server, however I cant connect to mysql and create the needed database
the code we are using is
$host = 'localhost'; $user = 'username'; $pass = 'password'; $dbname = 'gbook'; $query = "CREATE DATABASE $dbname"; mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_query($query) or die(mysql_error());all we get is the following error!
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
im geussing its the 'localhost' thats the problem, but the server we're trying to move to, is a shared host and gives you access to nothing. I have been told you can access mysql by changing localhost to the correct path but all the information we know is The MySQL installation directory ' /usr/local/mysql' and have no idea how to work out what the correct path is [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
could anyone help me out here? I have been looking round the net and there are loads of sites explaining how to sort this at the prompt, however we dont have access to one!