Copy cdr table's information into a file

Hi
I want to move CDR Table’s information (from mysql) in a “file” (Not cdr log file).
how do that?

Hello @saha,

Run this command in your Linux console:

mysql asteriskcdrdb -t -e"describe cdr;describe cel;" > /tmp/cdr_tables.txt

Thank you,

Daniel Friedman
Trixton LTD.

Thanks danielf

I did so, but cdr_tables.txt is empty.

Hello @saha,

Did you run the command mysql?

mysql asteriskcdrdb -t -e"describe cdr;describe cel;" > /tmp/cdr_tables.txt

if yes, please send the output of this command:

mysql asteriskcdrdb -t -e"show tables;"

Thank you,

Daniel Friedman
Trixton LTD

first: i enter to mysql and then type:

asteriskcdrdb -t -e"describe cdr;describe cel;" > /tmp/cdr_tables.txt

Hello @saha,

Please run this command from the Linux console and not from the mysql console.

Thank you,

Daniel Friedman
Trixton LTD

yes, i did so, but i just can connect to mysql with “freebxuser” user, not root, so with typing
mysql asteriskcdrdb -t -e “describe cdr;” > /tmp/cdr_tables.txt in linux console
i see : ERROR 1045 (28000) …

Hello @saha,

Please use the root user of your Linux environment to execute my command.

Thank you,

Daniel Friedman
Trixton LTD

Yeeess, But:

Hello @saha,

Ok, do you know your mysql root password (usually passw0rd)?

If yes, please use the -p flag to my command:
mysql asteriskcdrdb -p -t -e"describe cdr;describe cel;" > /tmp/cdr_tables.txt

Thank you,

Daniel Friedman
Trixton LTD.

unfortunately I dont Know the root pass, i tried some passwords like: root, admin, password ,… but didnt work, in amportal.conf and freepbx.conf files, there is no information about root password too.
Note: I didnt Install Mysql by myself, it was installed.

And any effort for set a new pass on root user were not successful.

Hello @saha,

You can get the tables structure with the freepbx user as well (take the details from the amportal.conf file):
mysql asteriskcdrdb -ufreepbxuser -p -t -e"describe cdr;describe cel;" > /tmp/cdr_tables.txt

Thank you,

Daniel Friedman
Trixton LTD.

oh, yes
It works! :slight_smile:
Thanks @danielf