Menu

Connecting to the MySQL port 3306 in the VM Appliance

2013-02-14
2013-02-15
  • Ryan Mahoney

    Ryan Mahoney - 2013-02-14

    I'm not a linux guru so I chose the VM appliance option to stand up NetDB in my environment. The tool seems to be working great so far. I'm running it under ESX so the integration with our network is a non-issue (its not accessing the network thru a NAT). I am being asked whether people can create an ODBC connector and leverage the MySQL database to produce some reports. I see that its listening on port 3306 however I am unable to see that the port is listening from a non-local machine (however the IP is pingable). Where in the Ubuntu distro (provided per the VM) can I make port 3306 available to outside connections? I understand how to create the ODBC connector, just need the port to be reachable...

     
  • Jonathan Yantis

    Jonathan Yantis - 2013-02-14

    Ryan,

    There's quite a few examples about how to setup MySQL for access from remote hosts, but I believe this will work.

    Edit /etc/mysql/my.cnf and change bind-address from localhost to the IP of the server. Remove any instances of skip-networking.

    Then restart MySQL and see if you can at least connect to port 3306 from another machine: /etc/init.d/mysql restart

    Then login to mysql and add a new read-only account. Change 1.1.1.1 to the IP of the remote server or the hostname if you have reverse DNS enabled.

    mysql -u root -p
    (Default root DB password is netdbadmin3742)

    CREATE USER 'netdb'@'1.1.1.1' IDENTIFIED BY 'somepassword';
    GRANT SELECT ON . TO 'netdb'@'1.1.1.1';
    FLUSH PRIVILEGES;

    Then try to connect from the remote server as netdb with whatever password you set.

    Hopefully that will do it. If not check out this page:
    http://www.debianhelp.co.uk/remotemysql.htm

     

    Last edit: Jonathan Yantis 2013-02-14
  • Ryan Mahoney

    Ryan Mahoney - 2013-02-15

    Thanks! This helped a bunch.

     

Log in to post a comment.