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.

How to disable Remote MySQL connections?

Discussion in 'General Discussion' started by H2Hosting.com, Nov 26, 2002.

  1. H2Hosting.com

    H2Hosting.com Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    192
    Likes Received:
    0
    Trophy Points:
    16
    Do you know how to disable Remote MySQL connections serverwide? Don't want to allow users to have this feature enabled in cpanel

    thanks

    P.S. do you know, does Cpanel count MySQL traffic?
     
  2. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    you cant really block this with out modifying the cpanel theme.

    Here's a cupple things you could do...

    update all of the Host fields to be &localhost& in the mysql.user database.table. You could setup a cron job to do this...

    Use iptables to block the mysql port (default: 3306)

    you might be able to get mysql to only bind to 127.0.0.1 but i'm not sure. if you could then it wouldnt listen to outside requests.
     
  3. desario

    desario Member

    Joined:
    Oct 30, 2002
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    You can have mysql start without TCP/IP networking, that way only local connections work (using unix sockets).

    This can be done by editing the mysql config file at /etc/my.cnf and adding &skip-networking& on a line underneath the &[mysqld]& section.

    For more options and a reference see http://www.mysql.com/doc/en/Option_files.html and http://www.mysql.com/doc/en/Command-line_options.html
     
Loading...

Share This Page