How to get access to CDR&CEL data from the DB? Asterisk Asterisk Support

I want to use the Grafana MYSQL datasource connector to view more
custom statistics and graphs.

This only has to be for the CDR/CEL data.

How can I get this data?

I have tried connecting via mysql and using the username and passwork in the /etc/asterisk files but that didn’t let me in.

Is there a another way i can access the data in semi-real time. So within 30 minutes would be ideal?

You need to create a mysql user account with appropriate access to the ‘asteriskcdrdb database’ from the address or name of the client trying to so access.

Unless Grafana is running locally on the machine, using the FreePBX databases as a data source will also require updates to mysql as it listens on localhost by default. You would need to update mysql to listen on an ip for access.

Actually ‘mysql servers’ use the internal mysql.users table to define the AccessControlList in a more granular fashion

mysql -u root mysql -e 'select user,host,password from user'

Although you are likely using mariadb and not mysql as your server, a definitive description of how to allow ‘users’ from ‘hosts’ with ‘privileges’ of <as defined> to the ‘tables’ in ‘databases’ is

https://dev.mysql.com/doc/refman/8.0/en/access-control.html

My first post was a TLDR happy synopsis exposing a couple of gotchas and a couple of misunderstandings.

We’re talking about two different things. What you mentioned has to be done no matter what, a proper user needs access for Grafana. What I was referring to was if Grafana wasn’t running locally on the PBX then mysql/maria conf file needs to be updated to listen on an IP that can be accessed by Grafana.

So which exact ‘mysql/maria conf file’ would that be? And what would it’s modified content look like ?

Uhm, depending on your distro it could be /etc/my.cnf or /etc/mysql/mysql.conf.d/mysqld.cnf. It’s the standard mysql/mariadb server configuration file. You would edit bind-address = 127.0.0.1 to something that isn’t localhost and allows remote access.

Fair enough and a good point, all my systems already listen on 0.0.0.0 though, but don’t allow passwordless root access. Some might need to check

/etc/mysql/mariadb.conf.d/50-server.cnf

and to check

lsof -i:3306