Reputation: 304
Hi I'm having problem with accessing database from one of my site to another..
I have one site say a.com and I want to replicate the database from this site to my another site say b.com...
I'm using Cpanel in both the sites. In site A.com, I have created a user with required privileges and also added the other website (b.com) in the access hosts..
Now to access a.com database from b.com, I can use the username and password I have created on a.com but I'm not sure what hostname should I use..
Website a.com use localhost as the hostname..what should I use with b.com..
Upvotes: 2
Views: 6381
Reputation: 304
we can get data from another site by using $.getJSON
function of jQuery
You can get detail information from http://api.jquery.com/jQuery.getJSON sites....
Upvotes: 0
Reputation: 589
if you can't connect to the database then it's better to develop some kind of api. Try this search api to use in external websites you might get some help.
Upvotes: 1
Reputation: 943142
Assuming:
… then it would be the ip address of the machine the database server is running on.
Upvotes: 1
Reputation: 174947
You should use a.com
, or a decent IP address/domain name that will correctly direct the connection to the database.
However, do note you will need to configure the incoming server to accept the connection (i.e. port forwarding, firewall etc).
Upvotes: 0