MySQL database remote access (Access Host)

akot2

Registered
Nov 29, 2006
2
0
151


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..



Thanks in advace..

Amit
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
If they are on different servers, then use the IP address or domain name instead of localhost.

If the site with the database is a cPanel account, then you will need to give permission for remote access. This is done in cPanel>>MySQL databases

Look towards the bottom for a section called Access Hosts.

Start with % (wildcard). Once it works then

Add the IP address of the server that is wishing to access the database.
Then delete the wildcard (%)
 

bulletz

Registered
Dec 21, 2006
1
0
151
hello:
i also have the same problem.
i already changed the "access hosts"
but this mysql error shows up
Code:
I cannot connect to the database because: Access denied for user 'username'@'domain_ip' to database 'the_DB'
any input is appreciated.
thanks in advance