Articles in this section
Category / Section

How to connect MariaDB in Bold BI if the server is not reachable?

Published:

If MariaDB and Bold BI are installed on separate machines, the MariaDB server must be made publicly accessible in order to connect it to Bold BI. It’s important to note that making your MariaDB server publicly accessible comes with significant security risks. You should ensure that your server is properly secured with firewalls, strong passwords, and other security measures before proceeding.

Here are the steps to make your MariaDB server publicly accessible:

  1. Edit MariaDB Configuration:
    • Open the MariaDB configuration file located at /etc/mysql/mariadb.conf.d/50-server.cnf or a similar location depending on your installation.
    • Locate the bind-address directive. It may look something like this bind-address = 127.0.0.1
    • Comment out the bind-address directive by adding a # at the beginning of the line to disable it, or change it to bind-address = 0.0.0.0 to allow connections from any IP address.
    • Save and close the file.

mariadb.png

Please be extremely careful with these changes, as exposing your database server to the internet can make it a target for attacks. The bind-address was set to 0.0.0.0 for the purpose of explanation… Always ensure that you’ve taken the necessary security precautions.

  1. Restart MariaDB:

    • Run the following command to restart the MariaDB service:
      sudo systemctl restart mariadb
      
  2. Create a User for Remote Access:

    • Log in to the MariaDB shell as the root user or another user with administrative privileges.

    • Create a new user and grant them privileges. Replace your_username, host_ip_addr, and your_password with appropriate values.

      CREATE USER 'your_username'@'host_ip_addr' IDENTIFIED BY 'your_password';
      GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'host_ip_addr' WITH GRANT OPTION;
      FLUSH PRIVILEGES;
      

      Here, host_ip_addr should be the public IP address from which you’ll be connecting or ‘%’ to allow from any IP address.

  3. Test the Connection:

    • Try connecting to the MariaDB server from the remote location using the command:
      mysql -u your_username -h your_server_ip -p
      
      Replace your_server_ip with the IP address of the server where MariaDB is running.
  4. Secure Your Server (Important):

    • Implement firewall rules to allow traffic only from specific IP addresses.
    • Use strong passwords and consider using SSL for connections.
    • Regularly update MariaDB and the operating system to patch security vulnerabilities.
  5. Connect from Bold BI:

    • After ensuring that you can connect to MariaDB remotely, use the host_ip_addr and the credentials of the user you created to connect MariaDB from Bold BI.

Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SM
Written by Siranjeevi Murugan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied