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.

'Additional MySQL Access Hosts' issue

Discussion in 'Database Discussions' started by Indianets, Nov 21, 2010.

  1. Indianets

    Indianets Well-Known Member

    Joined:
    Jun 13, 2008
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,

    I added an IP (say 1.2.3.4) on a server in WHM > Additional MySQL Access Hosts.

    And added it to all cPanels by clicking --- "After you have done this, if you would like to configure access from all users' accounts, Click Here.". I could see 1.2.3.4 was added under all cPanels of the server under 'Remote MySQL Hosts'.

    Now I want to remove this IP completely, so I removed from WHM and again clicked to configure all clients, but this does not remove 1.2.3.4 from all cPanels. How can I do this?

    Vijay
     
  2. chiefme

    chiefme Member

    Joined:
    Jan 21, 2009
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have exactly the same issue!
     
  3. minosjl

    minosjl Well-Known Member

    Joined:
    Jun 4, 2011
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    I think this is because of the cpanel cache.Could you please check your ip address is exists in the dir /var/cpanel/databases

    you can run the command grep ip /var/cpanel/databases/* , if its exists you can update the cache by running the cpanel binary " /usr/local/cpanel/bin/setupdbmap "

    Please check this from your end and update this post.Your reply is much appreciated ....
     
  4. Tam

    Tam Well-Known Member

    Joined:
    Jul 31, 2004
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    16
    Same issue, and the above did not resolve it. Seems there is no 'undo' for the 'do'.
     
  5. Indianets

    Indianets Well-Known Member

    Joined:
    Jun 13, 2008
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi Tam,

    After a bit of research, I could find that it's all stored in --

    Code:
    /var/cpanel/databases/grants_cpuser.yaml
    
    in format --

    Code:
    ---
    MYSQL:
      cpuser:
        cpuser:
          - GRANT USAGE ON *.* TO 'cpuser'@'1.2.3.4' IDENTIFIED BY PASSWORD '*XXXXXXXXXXXXXXXXXXXX'
          - GRANT USAGE ON *.* TO 'cpuser'@'localhost' IDENTIFIED BY PASSWORD '*XXXXXXXXXXXXXXXXXXXX'
    
    cpuser => users which show the IP under cPanel > Remote Database Access Hosts
    1.2.3.4 => The IP which we applied to all and couldn't be removed.

    It would be best if someone from cPanel can have a word on 'How Safe is to remove that line?'.

    Vijay
     
  6. 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
    Removing the line only removes the mapping for the cPanel file. It doesn't remove the SQL in the /var/lib/mysql/mysql table that stores the grants for the IPs. You'd have to remove them in MySQL command line, or in each individual cPanel.
     
  7. Indianets

    Indianets Well-Known Member

    Joined:
    Jun 13, 2008
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Tristan,

    I have checked the tables in db 'mysql' and the IP was not there. Could it be due to removing the IP from WHM and running for all account by clicking "click here".

    I mean I made the remote host textarea blank in WHM and then came back and updated for all users, which did update something for all users one by one in GUI. That probably removed the grants from mysql actually which you are referring to.

    It's always best to test, if possible, could you please test it's behavior on your test machine?

    Vijay
     
  8. 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
    In my tests, this did not occur. If I removed the IP in WHM > Additional MySQL Access Hosts area, then clicked "Save", I receive an error message:

    Next, if I then click the "Click Here" link below that, while it does show the various users updating, when I check /var/lib/mysql/mysql database, the mysql.user table still lists the IP under the database users who had it previously added as a Host.

    My test machine is running cPanel EDGE 11.31.3.3
     
Loading...

Share This Page