Psychz - Raviteja
Votes: 0Posted On: May 08, 2019 06:11:09
You can access MariaDB remotely if your server is connect to the internet but it is highly risky and you must assess all the measure to make it secure and use it wisely before you allow remote access to your database. Opening up your database servers directly to the internet is not recommended.
You may want to read steps to secure MariaDB before you proceed with steps to accessing it remotely here on our knowledgebase article https://www.psychz.net/client/kb/en/installing-mariadb-on-centos-7.html
By default, MySQL or MariaDB only listens for connections from the localhost. All remote access to the server is denied by default.
To enable remote access, run the commands below to open MySQL/MariaDB configuration file.
# nano /etc/mysql/mariadb.conf.d/50-server.cnf
Then make the below change below from:
bind-address = 127.0.0.1
To
bind-address = 0.0.0.0
After making the changes above, save the file and run the commands below to restart the server.
# systemctl restart mariadb.service
To verify that the changes done are reflecting, run the following command
# netstat -anp | grep 3306
The result should look like the one given below
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3213/mysqld
That’s it! You’ve successfully configured remote access to the MariaDB database server.
Note: Make sure to modify your Linux firewall to allow outside IP addresses to connect to port 3306