Jump to content


Photo

cant connect to local Mysql


  • Please log in to reply
2 replies to this topic

#1 thehigherentity

thehigherentity
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 19 June 2006 - 11:45 PM

for starters i have only been playing around with mysql for a few days so i know very little about it

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!
The best way to learn
is to ask you lot........

#2 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 20 June 2006 - 03:34 AM

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.

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#3 thehigherentity

thehigherentity
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 21 June 2006 - 02:59 PM

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.
The best way to learn
is to ask you lot........




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users