| 
		
			
			
				
			
			
				 
			
			
				
			
		 | 
		
			
			
				 
			
				
			
		 | 
	||||
| 
				Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.  You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us.  | 
		
		 
		![]()  | 
	
		
			
  | 	
	
	
		
		|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
| 
		 | 
	Thread Tools | 
| 
			
			 | 
		#1 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
			
			 
				
				Easy PHP question - how to NOT use localhost
			 
			What do I put in the place of "localhost" if I want to use a database on a seperate server. 
		
	
		
		
		
		
			The server's IP? The server's DNS? Thank you. 
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 bump for an answer 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Registered User 
			
		
			
			
			Join Date: Oct 2002 
				Location: Canada EH? 
				
				
					Posts: 74
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 i usally just put the address http://somehost.server.com i guess ip would work 
		
	
		
		
		
		
		
	
	, but i am pretty sure you have to have permissions on the database setup to allow outside connections  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Aug 2003 
				Location: Someplace Windy 
				
				
					Posts: 4,501
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 You use the database hostname or the database host IP. 
		
	
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Does this look right? Because it's not working... 
		
	
		
		
		
		
			PHP Code: 
	
			
	The above gives me a parse error, changing $newconnect = mysql_pconnect(64.**.120.**, $user,$pass); to $newconnect = mysql_pconnect(localhost, $user,$pass); gives me "Incorrect database name..." but the page still shows. 
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Registered User 
			
		
			
			
			Join Date: Oct 2002 
				Location: Canada EH? 
				
				
					Posts: 74
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 put the ip in quotes 
		
	
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#7 | ||
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 Quote: 
	
   Thx.
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
||
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Registered User 
			
		
			
			
			Join Date: Oct 2002 
				Location: Canada EH? 
				
				
					Posts: 74
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 so that worked or you still having trouble 
		
	
		
		
		
		
		
		
			
		
		
	
	 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#9 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 $newconnect = mysql_pconnect("64.**.120.**", $user,$pass); part gives me the error: Incorrect database name 'f***y_f*******s@64.**.120.**' 
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Registered User 
			
		
			
			
			Join Date: Oct 2002 
				Location: Canada EH? 
				
				
					Posts: 74
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 cut @64.**.120.** from the dbname 
		
	
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#11 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Sep 2003 
				
				
				
					Posts: 8,713
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 In the connection code you can just replace localhost to ip adress but the database you are connecting to should allow remote connections to it. It shold be configed in the mysql side. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	![]() TrafficCashGold Paying Webmasters Since 1996! Awesome Conversions! Fast Weekly Payments! Over 125 Tours!  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 Thank you very much. 
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Do I go into cPanel and under "access hosts" add the IP address of the site that will be accessing? 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Join Date: Feb 2004 
				Location: Vancouver, Canada 
				
				
					Posts: 7,662
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Now I am getting 
		
	
		
		
		
		
			Access denied for user: '@localhost' to database 'f***y_f***s' How do I allow permission? I added the IP and domain to access host where the DB resides. 
				__________________ 
		
		
		
		
	
	ICQ: 2262.73945  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 |