How to enable Remote access to your MariaDB/MySQL database

juandisay
5 min readMar 25, 2021

MariaDB is a free, open-source and one of the most popular relational database system around the globe. It is a drop-in replacement for MySQL database system. However, the structure and indexes of both database systems are same, this will allow you to switch your database from MySQL to MariaDB without having to alter your applications.

In this tutorial, using manually with shell access on a Ubuntu 20.04 multipass on Linux Localhost.

Enabling Remote Access

The steps are as follows:

  1. Run the “Enable Remote Mysql Access” script on your local or server
  2. Create a new database and dabase user which contains the word “remote” in the username. Such as “myremotedatabaseuser”

Please note: When using this method you are opening up port 3306 to the world and anyone who can guess your DB username and password may gain access. If you want to restrict users or your firewall port by e.g. IP — then you need to follow the manual setup method below.

If you need to grant remote access to an existing database you will need to grant the appropriate privileges to a new or existing user in MySQL using the command line, or alternatively using phpmyadmin — please see instructions on how to achieve…

--

--