Jump to content

Connecting to Remote Server


MinusMyThoughts

Recommended Posts

so, i'm working on my first MySQL project and i'm already stumped. i got a MySQL database up and running on my computer, and i've been able to work with that without problems. now i'm trying to get connected to my online database, and i can't......when i attempt to connect it tells me:"ERROR 2003 (HY000): Unknown MySQL server host 'myhostname' (11004)"i'm using both the C-Prompt and the MySQL Command Line Client that came with my download, both to no avail. my format is:>mysql connect -h hostname -u username -p...right off the FAQs. what am i doing wrong?...thanks so much for any help!love,jason

Link to comment
Share on other sites

You're not entering the hostname correctly. Enter either the domain name of the server, or the IP address. Either of them should work. But, the server might also be set to not accept remote connections. But the first step is to get the name right.

Link to comment
Share on other sites

so, the hostname i was given is "db525.perfora.net"...do i need something other than that? because that's exactly what i've been entering and it fails. i tried it once with "http://" in front, but that failed after thinking for a long time......any ideas? or should i start harassing my hosting service's tech support?...thanks!love,jason

Link to comment
Share on other sites

i called tech support and figured out that my hosting package doesn't allow C-Prompt access, but they've got a tool on their site that allows me to build my tables......they said i should be able to connect to the database via PHP, however......so now i might be asking the wrong question in the wrong forum, but when i attempted to connect to the database with PHP, it's not finding the database yet again......i'm pretty sure my syntax is correct:

<?php  $emailList = $HTTP_POST_VARS['emailList'];@ $db = mysql_pconnect('http://db525.perfora.net', 'username', 'password');  if (!$db)	{	echo 'Error: could not connect to the database. Please try again!';	exit;	}  mysql_select_db('email');  $query = "insert into email values		('".$emailList."')";  $result = mysql_query($query);  if($result)		  echo 'Thank you for signing up!<br/><br/>';	  echo 'The email address you submitted was: <b>'.$emailList.'</b><br/><br/>';	  echo '<a href="http://www.thenategreenexperience.com">Click here to be redirected back to the Nate Green 		Experience.</a>';?>

...my table structure is extremely basic:email(mailID, email)mailID is the primary key, auto_increment. email is supposed to store the email address entered in my input box when the user clicks "Sign Up!"...did i screw something up in my code?...any help is greatly appreciated...love,jason

Link to comment
Share on other sites

EDITthanks to the code jblack had up in another forum, i was able to get the code working. i gave you credit, jblack, in case anyone's wondering......thanks to justsomeguy for helping me determine that it wasn't just me that couldn't connect to the darn thing...love,jason

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...