hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Connecting to a remote db
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Connecting to a remote db

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-16-2005, 12:53 PM
m12345 m12345 is offline
New Member
 
Join Date: Jun 2005
Posts: 3

Connecting to a remote db


Hello guys,

This questions is about databases. Lets say i have a database at mywebsite1.com and i want the php script at mywebsite2.com to access the same databases as mywebsite1.com...

So in my php configuration file (where the db login details go), i assume

$dbhost='localhost'; would be changed to $dbhost='SOMETHING ELSE'; ???

I need to know what comes instead of localhost and where can i find that from my server. I was able to find something called

MYSQL_SOCKET /var/run/mysqld/mysqld.sock

is that it?

Thanks,

Reply With Quote


Sponsored Links
  #2  
Old 06-16-2005, 01:36 PM
ozarkhost ozarkhost is offline
Junior Guru Wannabe
 
Join Date: Jul 2003
Location: Missouri
Posts: 30
Either the ip address or hostname for example 127.0.0.1 or domainname.com also the mysql server will need to have the ip for the server getting the querys so that it has permission to do so.

Reply With Quote
  #3  
Old 06-17-2005, 12:55 AM
carguy84 carguy84 is offline
WHT Addict
 
Join Date: Jun 2005
Posts: 112
Yup, I always use a hostname(domain name) so if I ever move the DB server, I don't have to remember to change the IP address too.

Reply With Quote
Sponsored Links
  #4  
Old 06-25-2005, 07:47 AM
click2iceberg click2iceberg is offline
Disabled
 
Join Date: Jun 2005
Posts: 9
want to know php/mysql database ip address

Anybody tell me how to find the php/mysql database ip of domain.. I have site www . spellfinder . com and my programmer asking it's database ip to connect the software to website database..... I have search on cpanel , but couldnt find anything ... Plz help me to find it... thanks

Reply With Quote
  #5  
Old 06-25-2005, 02:17 PM
linuxentric linuxentric is offline
Newbie
 
Join Date: Jun 2005
Posts: 27
Normally we are connecting to mysql databases like $dbhost='localhost'

For a remote conection you can use th remote machines ipaddress
say ($dbhost='12.1.1.1')
and give the remote machines mysql username and password.

also if you have the remote machine host name try withthat also instead of the ip address.

__________________
Choose the right option ... The world is open for You..

Reply With Quote
  #6  
Old 06-25-2005, 03:10 PM
motyl motyl is offline
Junior Guru Wannabe
 
Join Date: Feb 2005
Location: Galway, Ireland
Posts: 33
It is very easy if you have all your domains on 1 server. Just do what others adviced. But if you run your domains from multiple servers, you will need to make sure that firewall and mysql config will allow connections from other servers. It's usually enabled only for 'localhost' connections by default.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
EarthLink Acquires Managed Services Provider CenterBeam for $22 Million Web Hosting News 2013-06-17 14:30:10
Savvis Launches Online Business Exchange for Data Center Customers Web Hosting News 2013-03-26 10:22:18
Hosting.com's New Online Backup Solution Offers Remote and Local Options Web Hosting News 2012-03-13 16:34:57
Web Host ViaWest Gets Efficient with Opengear Solutions Web Hosting News 2012-02-28 17:04:18
Monitoring Firm LabTech Software Launches Cloud Delivery Option Web Hosting News 2012-01-27 13:55:36


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?