Jump to content

Connecting to mysql server remotely

Orcblood
I'm having a hard time connecting to mysql server on my own phsycial server from another computer on the same network. I use ssh to communicate remotely with my server inside and outside the server's network. I can connect to mysql using phpmyadmin and see my databases and their records through a browser but can't using client code or software on my computer. I want to be able to run a script on my computer and to instantly see what's in a database without having to type phpmyadmin in url sign into phpmyadmin and go to the database and click on a table. I think why the phpmyadmin way works, and not my own code, is cause it runs on my server and not my computer. I've wasted so much time trying to figure out how to connect remotely and with different software. 

 

What I've done:

I've disabled the firewall on myserver(don't worry I won't keep it that way). I use webmin to manage my server and when I go to mysql datbase server within webmin and hit variables the bind_address variable is equal 127.0.0.1. Well I know I need to change that to 0.0.0 or whatever to allow remote access. 

 

The problem is my.cnf doesn't have anything in it. Well almost nothing. When I hit mysql server configuration it says "could not find [mysqlid] section in my.cnf". Attached is the contents of the my.cnf in /etc/mysql/my.cnf. How do I change the bind address? I'm almost certain that will solve my problem. From online I see that everyone's my.cnf looks very different and has variables inside of it. Mine doesn't. Maybe cause I'm running the latest mysql server. 5.6.25-0ubuntu0.15.04.1

 

I have attached 3 files, a python script on my computer that trys to connect to a mysql database remotely, that script's output, and the contents of my.cnf file.

 

Help!

 

 

post-38513-0-71765100-1444595698.png

post-38513-0-93513500-1444595701.png

post-38513-0-33143900-1444596167.png

Link to comment
Share on other sites

Link to post
Share on other sites

Well someone helped me out on another forum. The answer was going to /etc/mysql/mysql.conf.d/ like what is listed in the 3rd image of my post. From there I edited the mysqld.cnf file and set the bind-address equal to 0.0.0.0. Apparently this is the new way of config files for mysql. It doesn't just keep it all in one file like I think most people showed on the internet. I'm running a rather new version of mysql. Anyway, fixed my problems! Just thought I would follow up here.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×