[resolved] MySQL CDR

I am having trouble using MySQL CDR. Here’s the table I’ve created in MySQL:

mysql> describe cdr;
+-------------+--------------+------+-----+---------------------+-------+
| Field          | Type           | Null  | Key | Default                | Extra |
+-------------+--------------+------+-----+---------------------+-------+
| calldate      | datetime      |        | MUL | 0000-00-00 00:00:00 |       |
| clid           | varchar(80)  |        |        |                     |       |
| src            | varchar(80)  |        |       |                     |       |
| dst            | varchar(80)  |        | MUL |                     |       |
| dcontext    | varchar(80)  |        |       |                     |       |
| channel     | varchar(80)  |        |       |                     |       |
| dstchannel | varchar(80)  |        |       |                     |       |
| lastapp      | varchar(80)  |        |       |                     |       |
| lastdata     | varchar(80)  |        |       |                     |       |
| duration     | int(11)         |        |       | 0                   |       |
| billsec        | int(11)         |        |       | 0                   |       |
| disposition  | varchar(45)  |       |       |                     |       |
| amaflags    | int(11)         |        |       | 0                   |       |
| accountcode | varchar(20)  |      | MUL |                     |       |
| userfield     | varchar(255) |       |       |                     |       |
+-------------+--------------+------+-----+---------------------+-------+
15 rows in set (0.00 sec)

And this is a snip of the asterisk console when reloading:

    -- Reloading module 'cdr_addon_mysql.so' (MySQL CDR Backend)
  == Unregistered 'mysql' CDR backend
  == Parsing '/etc/asterisk/cdr_mysql.conf': Found
Aug  2 14:36:12 NOTICE[31927]: cdr_addon_mysql.c:376 my_load_module: MySQL database table not specified.  Assuming "cdr"
Aug  2 14:36:12 ERROR[31927]: cdr_addon_mysql.c:437 my_load_module: Failed to connect to mysql database asteriskcdrdb on 66.241.6.130.

I’m sure it is something simple - any help would be appreciated.

try to connect to yours mysql server using informations that you have enter on cdr_mysql.conf.

Fred

[quote=“fred_m”]try to connect to yours mysql server using informations that you have enter on cdr_mysql.conf.

Fred[/quote]

I was able to do that. I had previously created that user and granted him all privileges on the asteriskcdrdb database. Any other suggestions?

You are able to long in mysql using

mysql -u [asteriskuser] -p ?

[quote=“Dimitripietro”]You are able to long in mysql using

mysql -u [asteriskuser] -p ?[/quote]

Yes. Here’s my cdr_mysql.conf

[global]
hostname=x.x.x.x
dbname=asteriskcdrdb
password=@st3r1sk
user=asterisk
;port=3306
sock=/var/lib/mysql/mysql.sock
;userfield=1

I have mysql set up so I can login in as follows:

mysql -u asterisk -p

I then give the password, which in this case is @st3r1sk

I solved the problem. When I used the GRANT command to give rights to user ‘asterisk,’ I did not include the IDENTIFIED BY clause. So, I could connect using that username/password combo when invoking mysql from the unix command line, I did not have the proper permissions from within *.