Allowing the MYSQL/MariaDB to accept outside connections

By default when you install the MYSQL or MariaDB server it will bind to `127.0.0.1` which essentially means that the service is binded to a local interface thus stopping you from connecting externally. Below are the steps to making sure your database is ready for external connections

We are going to want to start by changing our bind address, if you navigate to /etc/mysql/ & open your my.cnf you should find all of your SQL server parameters, we are wanting to look for the bind option is should by default be set at 127.0.0.1 the embedded line should look like this:

bind-address           = 127.0.0.1

you should now change it to 

#bind-address           = 127.0.0.1

Make sure to close & save the file this can be done by pressing ctrl+x followed by y then pressing the enter key, our config file has now been saved to disk. The SQL service needs to now be restarted 

sudo service mysql restart

or

 service mysqld restart

Your SQL server is now listening for external connections!

No Comments

Back to top