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.

Remote MySQL server + "Add a New IP Address" messes up

Discussion in 'Database Discussions' started by Eiler, Sep 25, 2011.

  1. Eiler

    Eiler Member
    PartnerNOC

    Joined:
    Oct 18, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I've set up the remote mysql server - that works without any issues exactly as I want it too. But when I add a new ip address to the system, so a shared hosting client of mine can get a dedicated ip address, and tries to open phpmyadmin in whm, the I'm presented with the following error:


    Error

    SQL query: Edit

    SET CHARACTER SET 'utf8';

    MySQL said:

    #1130 - Host 'new.ip.new.ip' is not allowed to connect to this MySQL server


    Why is this? I were expecting cPanel to automatically take care of this. Also I don't understand why the mysql server thinks I'm accessing it form the newly added ip address instead of the primary ip address set for the cpanel server (which is working fine).

    Any help or good ideas will be very appreciated :) Thanks!
     
  2. Eiler

    Eiler Member
    PartnerNOC

    Joined:
    Oct 18, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    *BUMP* - any help?
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you add that dedicated IP in WHM > Additional MySQL Access Hosts area, does it then work?
     
  4. Eiler

    Eiler Member
    PartnerNOC

    Joined:
    Oct 18, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    The issue was caused by network protocol. The new IP is on the same subnet as the remote MySQL IP. The main ip of the cPanel server is on a different subnet than the mysql server and the new ip. As such, the new IP takes precedence as the outbound route to connect to the MySQL server.

    It appears that WHM :: Main >> SQL Services >> Additional MySQL Access Hosts added extra users for all the database users, just not root.

    eg. A user as seen in phpmyadmin

    Apartart xxx.xxx.1.1 Yes USAGE No Edit Privileges Edit Privileges Export Export
    Apartart xxx.xxx.2.1 Yes USAGE No Edit Privileges Edit Privileges Export Export

    vs root

    root 127.0.0.1 No ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
    root xxx.xxx.1.1 Yes ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
    root localhost No ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export

    I added root@xxx.xxx.2.1 to the mysql userlist and phpmyadmin worked after that.


    After that, it worked. So because the new ip was on the same subnet as the mysql server, and cPanel's main ip is not, the new ip was considered the "main" ip by the mysql server, which caused the problem as this didn't have access to it.
     
  5. mvel001

    mvel001 Member

    Joined:
    Sep 8, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello People, I also have a problem with "Additional MySQL Access Hosts" feature.

    I got to CONNECT to MySql database ( $db = mysql_connect(this-host,user,passw) which runs successfully on remote serve)

    but... it can´t SELECT a database into ( mysql_select_db(database-name,$db) fails )

    I tried user = database-name owner and also user = root , but both failed.

    When executing on "localhost" mode mysql_select_db works fine

    what would be happening here? , I searched cPanel for some "additional database access hosts" or something else, but nothing found. Permissions appears given for entire mysql connections and not for specific databases. I have permission for remote mysql , but not for selected database.
     
Loading...

Share This Page