PDA

Voir la version complète : Failed to connect to mysql database asterisk on localhost.



VirtualCed
27/01/2011, 17h43
Je suis super perplexe...
En effet, je suis sous ubuntu, j'ai installé Asterisk version paquet + le addon pour mysql
J'ai édité le fichier cdr_mysql.conf de la sorte



[global]
hostname=localhost
dbname=asterisk
table=cdr
user=cdr
password=monmotdepasse
sock=/var/lib/mysql/mysql.sock
userfield=1
port=3306

Si je tape en ligne de commande


mysql -h localhost -u cdr -p asterisk
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 159
Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

mysql>


Je n'ai aucun soucis. Par contre Asterisk, lui n'arrive pas à se connecter


== Parsing '/etc/asterisk/cdr_mysql.conf': == Found
[Jan 27 10:53:21] ERROR[28562]: cdr_addon_mysql.c:520 my_load_module: Failed to connect to mysql database asterisk on localhost.
cdr_addon_mysql.so => (MySQL CDR Backend)

Je suis donc très perplexe...
Si quelqu'un a une idée...