The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting up MySQL Remote Access...

Discussion in 'Database Discussions' started by sflc2000, Jun 15, 2006.

  1. sflc2000

    sflc2000 Registered

    May 9, 2006
    Likes Received:
    Trophy Points:
    Searched the forums, and followed most/all suggestions that were relevent, but still not working. MySQL does work on this server for local domains, just not the remote domain that we are trying to setup to share one of the databases on the local server.


    WMH 10.8.0
    CPanel 10.8.0
    CentOS 4.3
    No firewall (yet)

    Added the IP address of the remote domain to the Additional MySQL Access Hosts via WHM and to Access Hosts for the specific domain via CPanel. Also added the IP address of the remote server (the box IP). Also tried wildcard %. Also tried restarting services.

    Checking with netstat -nltap | grep mysqld shows:

    tcp 0 0* LISTEN 26775/mysqlid

    The PHP script on the remote domain is using:

    hostname: (also tried just the IP of the local)

    Result: Can't connect to MySQL server on '' (111)...

    Also tried to access via the command line on the remote server using:

    mysql -h

    Result: ERROR 2003: Can't connect to MySQL server on '' (111)

    Probably just overlooking something?

    ** EDITED **

    Got it working, here's what I did:

    Edited /etc/my.conf and commented out the line for bind address
    # bind-address=

    Restarted mysql
    /etc/init.d/mysql restart

    Tried accessing via the PHP script on the remote host to test.
    Got an error refering to the IP Address of the 2nd nameserver on the remote server (why?) not allowed to access mysql on the local server, but at least it was seeing it.

    Added that IP address to the Access Hosts via WHM and CPanel

    Tried it again, and it worked!

    So... with that, then ANY php script from the remote server can access the database on the local server, not exactly what was intended.

    Any feedback appreciated on how to narrow it down to just the one other domain on the remote server being allowed to access the database on the local server. Thanks in advance.
    #1 sflc2000, Jun 15, 2006
    Last edited: Jun 15, 2006
  2. myusername

    myusername Well-Known Member

    Mar 6, 2003
    Likes Received:
    Trophy Points:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    This is a pretty old thread, but i figured I would mention it if you were still unsure of the correct settings.

    it should be as simple as adding the remote access host IP address on your DB server.

    Then your config file on the remote host should work fine straight up as
    dbname: dbname_dbname
    dbuser: dbuser_dbuser
    sbpass: dbpass

    If you cannot connect make sure you do not have tcp port 3306 disabled in your incoming/outgoing firewall rules, respectively. You stated no firewall but that doesn't mean that you don't have rules in your IPtables from someone else who might have put them there. Iptables is on your machine by default most likely.

    You should be able to telnet 3306 from the remote host and get a mysql greeting or deny message.

Share This Page