We do not recommend creating an external shortcut to the database for security. But if you know what you’re doing, you’ll know your own risks.
In order to remotely access MySQL (MariaDB) in VitalPBX you must follow the following steps.
- Make sure that port 3306 is not blocked in your firewall
- Create the Service in the VitalPBX Firewall (Admin/Firewall/Services) with port 3306
- Create the Rule (Admin/Firewall/Rules) to use the previously created Service.
- Go to your server console and modify the 50-server.cnf file.
bind-address = 127.0.0.1
bind-address = 0.0.0.0
Finally, restart MariaDB.
sudo systemctl restart mariadb
- And last but not least, configure the DB credentials to access remotely.
root@vitalpbx:~# mysql -uroot MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO USERNAME@'YOUR_PUBLIC_IP' IDENTIFIED BY 'PASSWORD'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit
With *.* you can access all databases. If you only want the CDR database you must write asterisk.*