1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL database remote access (Access Host)

Discussion in 'Database Discussions' started by akot2, Nov 29, 2006.

  1. akot2

    akot2 New Member

    Joined:
    Nov 29, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1


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

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,288
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Houston, TX
    If a.com and b.com are on the same server, then you can use localhost.
     
  3. d-woo

    d-woo Member

    Joined:
    Aug 9, 2003
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    6
    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 (%)
     
  4. bulletz

    bulletz New Member

    Joined:
    Dec 21, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  5. Manuel_accu

    Manuel_accu Member

    Joined:
    Jun 19, 2005
    Messages:
    191
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    Code:
    GRANT ALL PRIVILEGES ON `the_DB` . * TO 'username'@ 'domain_ip';
    Ty above sql query from MySQL prompt. and flush the prvileges. Check from your end.

    Thanks,
     

Share This Page