Enable remote connection to asteriskcdrdb on freepbx

  • mysql

  • show databases;

  • use asteriskcdrdb;

  • SELECT User, Host, Password FROM mysql.user;  ( if new user already created)

  • CREATE USER 'someuser' IDENTIFIED BY 'somepassword';

  • GRANT USAGE ON *.* TO 'someuser'@'someipaddress' IDENTIFIED BY 'somepassword';

  • GRANT SELECT ON asteriskcdrdb.* TO 'someuser'@'someipaddress' identified by 'somepassword';

  • FLUSH PRIVILEGES;

  • SELECT User, Host, Password FROM mysql.user; ( to show all MySQL/mariadb Users)
  • quit

 

Now verify that the remote user can connect to the Mariadb server/PBX run the following command:

  • mysql -u someuser -h pbx_ip -p

Enter password:

  • Allow access from  some IP address:

  • iptables -A INPUT -s someipaddress -p tcp --destination-port 3306 -j ACCEPT

  • iptables-save

Now download DBeaver Community universal database tool to connect to asteriskcdrdb ( or any other db tool i.e workbench) to connect to asteriskcdrdb as following:

Download

 

Reference: 

Remote CDR 

Return to Documentation Home I Return to Sangoma Support