[Asterisk-Users] cdr_mysql: cannot connect

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Sun Sep 14 23:46:00 MST 2003


On Sunday 14 September 2003 20:36, asterisk at kcwebpro.net wrote:
> I don't know if I have something screwed up with my MYSQL
> installation/Asterisk install or a bad configuration.  I have
> imported the tables into a MYSQL database residing on localhost.  I
> have check permissions on the user as well as the password and I have
> the same error comin up.  I have succesfully connected to the
> database remotely and with MYPHPAdmin with the same setting below is
> a copy of my cdr_mysql.conf
>
> [global]
> hostname=192.168.2.9
> dbname=asteriskcdr
> user=asteriskcdr
> password=<password>
> port=3306
> sock=/tmp/mysql.sock
>
>
> The error I am getting is:
> ERROR[1209214400]: File cdr_mysql.c, Line 71 (mysql_log): cdr_mysql:
> cannot connect to database server localhost.  Call will not be
> logged.

Uh, are you sure this is your configuration?  It says it's trying to
connect to localhost, but you have a non-localhost IP in the hostname
field.  Try changing that to the word "localhost".

Also try from the command line:

mysql -uasteriskcdr -h 192.168.2.9 -p asteriskcdr

and see if it connects (or denies you).  Also, check to see if
/tmp/mysql.sock is the connecting sock file and not
/var/lib/mysql/run/mysql.sock (which is the case on some distros).

> I am also getting this message though it might be unrelated:
> WARNING[1142106560]: File chan_sip.c, Line 435 (retrans_pkt): Maximum
> retries exceeded on call 1ec6564257f5e18b15c350742dcc5e68 at 192.168.2.9
> for seqno 102 (Request)

Nope, unrelated.

-Tilghman




More information about the asterisk-users mailing list