Skip to main content

Remove MySQL remote access IP from all accounts

Comments

5 comments

  • kodyxgen
    I found a solution, i don't know if it is the best but i will share it with you so if anybody will be in the same situation. in mysql database there are two tables that i altered the db one and the user one, this of course after taking a dump of them. I deleted all the `host` that where added there with an sql
    DELETE FROM `user` WHERE `host` NOT IN (and here i put my server main ip and hostname) and user <> root
    And i did the same thing for the db table to. and all the remote mysql ip's where gone from cPanel user account's
    0
  • 24x7server
    Hello, I need to delete all remote mysql ip's from cPanel user accounts, is there any possibility to do this from ssh so i don't have to enter in every account and delete the ip address ?

    If you have a CSF installed, all you have to do is disable the IP access to the port 3306 for those users and after doing so, even if they have enabled remote MySQL, your server firewall is still not going to allow them to access it..
    0
  • kodyxgen
    If you have a CSF installed, all you have to do is disable the IP access to the port 3306 for those users and after doing so, even if they have enabled remote MySQL, your server firewall is still not going to allow them to access it..

    Thank you for your response. I have CSF installed and that would it be the solution if i head 10 - 20 accounts but i have more than that and some of them really need remote mysql connection. Thank you once more for taking the time to respond.
    0
  • 24x7server
    Hi, Anyways, to have the Remote MySQL connection worked properly, you will need the IP also added to the firewall, so you can allow only legitimate one those require the connection and others those you have this enabled in cPanel, will still not be able to access it as the firewall is already guarding the connection to the database port..
    0
  • cPanelMichael
    Hello, You can find discussion of this topic on the following thread as well: Additional MySQL Access Hosts Thank you.
    0

Please sign in to leave a comment.