Enabling Remote Access to MariaDB/MySQL: A Step-by-Step Guide

Configuring Remote Database Access for MariaDB / MySQL.

Avatar

In this tutorial, we will discuss how to enable remote access to MariaDB, which can also be applied to MySQL by referencing the correct file path and name. This allows you to access the database from another server or desktop application on Windows or macOS.

  1. Start by modifying the MariaDB configuration file:

    Locate the line containing bind-address and change it to:

    Save the changes and restart MariaDB:


     

  2. Next, open port 3306 in UFW (Uncomplicated Firewall) with the following commands:

     

  3. Create a new user specifically for remote access in MariaDB:

     

  4. To grant remote access to a specific database, run this command:

     

    If you want to allow remote access to all databases, use the following command:


     

Keep in mind that enabling remote database connections comes with security risks. Proceed with caution.

This information should prove beneficial for configuring remote access to your MariaDB database.

Leave a Reply

Your email address will not be published. Required fields are marked *