{"data":{"external_id":1482,"slug":"make-mysql-accessible-from-outside","title":"Make MySQL accessible from outside","content":"If you install a MySQL or MariaDB server on your virtual server, it will be installed automatically with the &#8222;Allow local only&#8220; rule. If you want to make the server accessible from outside, you have to change the configuration of the server.\nWe will show you with an example (MariaDB) how to do this.\nError message which means that MySQL is not reachable from outside:\nERROR 2002 (HY000): Can't connect to MySQL server on '168.119.29.XXX' (115)\nRequirements\nYou need a Linux server.You must have MariaDB installed (apt-get install mariadb-server).The port 3306 must be released in a firewall, if one is used.You have created a user that can either access from anywhere &#8222;%&#8220; or is filtered by IP address\/host.\nCustomize configuration\nModify the file \/etc\/mysql\/mariadb.conf.d\/50-server.cfg. Open it with an editor of your choice.\nIn the area under [mysqld] you will find the setting &#8222;bind-address&#8220;. Change the configuration as described below.\nBefore\n# Instead of skip-networking the default is now to listen only on\n# localhost which is more compatible and is not less secure.\nbind-address = 127.0.0.1\nAfter\n# Instead of skip-networking the default is now to listen only on\n# localhost which is more compatible and is not less secure.\nbind-address = 0.0.0.0\nSave the file and restart your database server.\nsystemctl restart mysql\nAfter that, your MySQL server is also accessible from the outside. For security reasons, we strongly recommend that you create a separate MySQL account for external users. The root access should only work internally.\nIf you have any questions about this topic, please contact us. We will be happy to help you!","schema":null,"facts":[],"links":[]}}