thehigherentity Posted June 19, 2006 Share Posted June 19, 2006 for starters i have only been playing around with mysql for a few days so i know very little about itI 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 [code]$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());[/code]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! Quote Link to comment https://forums.phpfreaks.com/topic/12425-cant-connect-to-local-mysql/ Share on other sites More sharing options...
hackerkts Posted June 20, 2006 Share Posted June 20, 2006 I just went to yahoo search and found this:[a href=\"http://www.codecomments.com/PHP_SQL/message323526.html\" target=\"_blank\"]http://www.codecomments.com/PHP_SQL/message323526.html[/a]Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/12425-cant-connect-to-local-mysql/#findComment-47543 Share on other sites More sharing options...
thehigherentity Posted June 21, 2006 Author Share Posted June 21, 2006 I have already read that site and a number of others, however I still cant find a solution, I guess I just wont bother and change it to a flat file system its easier. Quote Link to comment https://forums.phpfreaks.com/topic/12425-cant-connect-to-local-mysql/#findComment-48063 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.