[asterisk-users] CDR/MySQL basic config

Adrian Marsh Adrian.Marsh at ubiquisys.com
Tue Aug 7 09:17:59 CDT 2007


Hi Alessandro,

 

Thanks for that.. I'm pretty sure about the user. I used Webmin to
confirm the user configs, but I ran your commands anyway:

 

 

mysql> use mysql ;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> select Host from user where User = 'asteriskcdruser' ;

+-----------+

| Host      |

+-----------+

| localhost |

+-----------+

1 row in set (0.00 sec)

 

mysql> grant insert on asteriskcdrdb.* to asteriskcdruser at localhost
identified by 'asteriskcdruser';

Query OK, 0 rows affected (0.00 sec)

 

But I still get the failure:

 

[Aug  7 15:14:10] ERROR[29103]: cdr_addon_mysql.c:436 my_load_module:
Failed to connect to mysql database asteriskcdrdb on localhost.

cdr_addon_mysql.so => (MySQL CDR Backend)

[Aug  7 15:14:10] ERROR[29103]: res_config_mysql.c:627 mysql_reconnect:
MySQL RealTime: Failed to connect database server  on  (err 2002). Check
debug for more info.

[Aug  7 15:14:10] WARNING[29103]: res_config_mysql.c:474 load_module:
MySQL RealTime: Couldn't establish connection. Check debug.

[Aug  7 15:14:10] NOTICE[29103]: config.c:1171
ast_config_engine_register: Registered Config Engine mysql

MySQL RealTime driver loaded.

res_config_mysql.so => (MySQL RealTime Configuration Driver)

 

This box also das Cacti installed on it, which makes use of the MySql
server as well (and all is ok there).

 

 

Adrian Marsh

  

________________________________

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Alessandro
Russo
Sent: 07 August 2007 14:13
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] CDR/MySQL basic config

 

Hi, 
first step is correct 

	Hmm.. This is what I get:
	
	[root at ubiq-serv6 ~]# mysql -u root -p
	Enter password:
	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 187143 to server version: 4.1.20
	
	Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 

	You make an errore here : mysql> use asteriskcdrdb 

users' information are stored in mysql db

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed 
mysql               

mysql> select Host from user where User = 'asteriskcdruser' ;
+-----------+
| Host      |
+-----------+
| localhost |
+-----------+
1 row in set (0.00 sec)

mysql> 

Are you sure that user 'asteriskcdruser' has the privileges to insert
record in DB "asteriskcdrdb"?
If not...allow 'asteriskcdruser' to insert record ^_^

mysql> grant insert on asteriskcdrdb.* to asteriskcdruser at localhost
identified by 'asteriskcdruser';
mysql> exit

Reload asterisk and try 




On 8/7/07, Adrian Marsh < Adrian.Marsh at ubiquisys.com> wrote:


Hmm.. This is what I get:

[root at ubiq-serv6 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 187143 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use asteriskcdrdb ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A 

Database changed
mysql> select Host from user where User = 'asteriskcdruser' ;
ERROR 1146 (42S02): Table 'asteriskcdrdb.user' doesn't exist
mysql>


Adrian Marsh
-----Original Message----- 
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com ] On Behalf Of Forrest
Beck
Sent: 07 August 2007 02:59
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] CDR/MySQL basic config

Adrian,

What host/ip did you specify when you created the user? 

#> mysql --user=root --password

#mysql> use mysql;

#mysql> select Host from user where User = 'asteriskcdruser'
(this line is case sensitive)

Does it return 127.0.0.1 or localhost.  Make cdr_mysql reflect that.

You should also check out cdr_odbc, asterisk can connect through an
ODBC connection which in turn is a connection to the MySQL database.
There seems to be more suport for the ODBC driver. 

Hope this helps some....



On 8/6/07, Adrian Marsh <Adrian.Marsh at ubiquisys.com> wrote:
> Hi,
>
> I'm trying to add mysql CDR onto a vanilla Asterisk 1.2 install.  The
> add-ons pack has been installed for a while, so now I'm trying to add
> the Mysql config.
>
> I've created a mysql database, added the grants for a user acces, and
> can run a mysql -u asteriskcdruser -p and can connect to the database.

>
> I've been using this as a guide:
>
http://www.757.org/~joat/wiki/index.php/Asterisk#Viewing_CDR_Data_with_A

> sterisk:_CDR_Analyzer
>
> I've created cdr_mysql.conf:
>
> [global]
> hostname=localhost
> dbname=asteriskcdrdb
> table=cdr
> password=password
> user=asteriskcdruser 
> port=3306
> sock=/tmp/mysql.sock
> userfield=1
>
> But when I start asterisk (1.4 on my test machine), I get:
>
>   == Parsing '/etc/asterisk/cdr_mysql.conf': Found
> [Aug  6 21:01:14] ERROR[32512]: cdr_addon_mysql.c:436 my_load_module:
> Failed to connect to mysql database asteriskcdrdb on localhost.
> cdr_addon_mysql.so => (MySQL CDR Backend)
> [Aug  6 21:01:14] ERROR[32512]: res_config_mysql.c:627 
mysql_reconnect:
> MySQL RealTime: Failed to connect database server  on  (err 2002).
Check
> debug for more info.
> [Aug  6 21:01:14] WARNING[32512]: res_config_mysql.c:474 load_module:
> MySQL RealTime: Couldn't establish connection. Check debug. 
> [Aug  6 21:01:14] NOTICE[32512]: config.c:1171
> ast_config_engine_register: Registered Config Engine mysql
> MySQL RealTime driver loaded.
> res_config_mysql.so => (MySQL RealTime Configuration Driver) 
>
>
> I'm also looking as to what CDR viewers there are available, and which
> people think are best.  I want to view/report on the calls made within
> A*k.
>
> Thanks,
> 
> Adrian
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list 
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>


--
***
Forrest Beck 
IAXTEL: 17002871718
jonforrest.beck at gmail.com
http://www.shift8.biz

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com-- 

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




-- 

Alessandro R. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070807/b9a65d78/attachment.htm 


More information about the asterisk-users mailing list