Can someone tell me what is wrong here: Feb 2 19:45:44 ERROR[1074441696]: cdr_addon_mysql.c:381 my_load_module: Failed to connect to mysql database asteriskcdrdb on localhost. The database is created, cdr table also, the username and password is right. I have tried configuring cdr_mysql.conf to connect via localhost mysql.sock or via tcp port, but in both cases I got this error. Thanks! Tomica Crnek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20040202/49c83d04/attachment.htm
On Mon, 2004-02-02 at 12:49, Tomica Crnek wrote:> Can someone tell me what is wrong here: > > Feb 2 19:45:44 ERROR[1074441696]: cdr_addon_mysql.c:381 > my_load_module: Failed to connect to mysql database asteriskcdrdb on > localhost. > > The database is created, cdr table also, the username and password is > right. > I have tried configuring cdr_mysql.conf to connect via localhost > mysql.sock or via tcp port, but in both cases I got this error.Have you checked your mysql logs to see if it was contacted, and maybe turned away? -- Steven Critchfield <critch@basesys.com>
-----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Steven Critchfield Sent: Monday, February 02, 2004 8:02 PM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] cdr mysql problem On Mon, 2004-02-02 at 12:49, Tomica Crnek wrote:> Can someone tell me what is wrong here: > > Feb 2 19:45:44 ERROR[1074441696]: cdr_addon_mysql.c:381 > my_load_module: Failed to connect to mysql database asteriskcdrdb on > localhost. > > The database is created, cdr table also, the username and password is > right. > I have tried configuring cdr_mysql.conf to connect via localhost > mysql.sock or via tcp port, but in both cases I got this error.Have you checked your mysql logs to see if it was contacted, and maybe turned away? -- Steven Critchfield <critch@basesys.com> Yes, I have checked the logs. There is nothing there. I think asterisk doesn't try to connect. Tomica
Hi, here it is... [root@ceres asterisk]# cat cdr_mysql.conf ; ; Note - if the database server is hosted on the same machine as the ; asterisk server, you can achieve a local Unix socket connection by ; setting hostname=localhost ; ; port and sock are both optional parameters. If hostname is specified ; and is not "localhost", then cdr_mysql will attempt to connect to the ; port specified or use the default port. If hostname is not specified ; or if hostname is "localhost", then cdr_mysql will attempt to connect ; to the socket file specified by sock or otherwise use the default socket ; file. ; [global] hostname=localhost dbname=asteriskcdrdb password=****** user=asteriskcdruser ;port=3306 ;sock=/tmp/mysql.sock sock=/var/lib/mysql/mysql.sock srwxrwxrwx 1 mysql mysql 0 Feb 2 19:37 /var/lib/mysql/mysql.sock Tomica -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Tilghman Lesher Sent: Tuesday, February 03, 2004 12:32 AM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] cdr mysql problem On Monday 02 February 2004 15:27, Tomica Crnek wrote:> Yes, I have checked the logs. There is nothing there. I think asterisk> doesn't try to connect.Please paste the contents of /etc/asterisk/cdr_mysql.conf. Also, paste the output of: ls -l /tmp/mysql.sock /var/lib/mysql/mysql.sock ; locate mysql.sock -Tilghman _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Hi You have to follow this steps and obviously you got success because we have followed this steps and got success. Configure the cdr_mysql.conf file in the location /etc/asterisk. The configuration is as follows: [global] hostname=localhost ;This is the host name of MySql dbname=asteriskcdrdb ;This is the database name of MySql password=password ;This is the password of user user=asteriskcdruser ;This is the user in MySql port=3306 ;This is the port number running the MySql sock=/var/lib/mysql/mysql.sock ;This is the socket of MySql and the location Then follow the steps in the MySql server 1. Go to Start Application>>System>>Service Configuration. Check the mysqld box. Click the save button Then click the start button. 2. Open a kolsole. 3. Type: "mysql -u root" to enter into mysql. 4. Type: "SET PASSWORD FOR root = PASSWORD("password");" for setting the root password. 5. Type: "GRANT ALL PRIVILEGES ON *.* TO asteriskcdruser@localhost IDENTIFIED BY "password" WITH GRANT OPTION;" 6. Type: "\q;" to Quit mysql. 7. Type: In konsole "mysql -u asteriskcdruser -p" and use the password "password", to reenter mysql as "asteriskcdruser" user. 8. Type: "CREATE DATABASE asteriskcdrdb;" 9. Type: "CREATE TABLE cdr ( calldate datetime NOT NULL default '0000-00-00 00:00:00', clid varchar(45) NOT NULL default '', src varchar(45) NOT NULL default '', dst varchar(45) NOT NULL default '', dcontext varchar(45) NOT NULL default '', channel varchar(45) NOT NULL default '', dstchannel varchar(45) NOT NULL default '', lastapp varchar(45) NOT NULL default '', lastdata varchar(45) NOT NULL default '', duration int(11) NOT NULL default '0', billsec int(11) NOT NULL default '0', disposition varchar(45) NOT NULL default '', amaflags int(11) NOT NULL default '0', accountcode varchar(45) NOT NULL default '', uniqueid varchar(45) NOT NULL default '' );" for create a table "cdr". 10. To reload the configuration, type reload from the Asterisk command prompt. These are the steps of Configuration of MySql with Asterisk server. Contact me if you need any further clarifications. Dipak Kumar Paul. Sigmabit Technology India. asterisk-users@lists.digium.com wrote: Hi, here it is... [root@ceres asterisk]# cat cdr_mysql.conf ; ; Note - if the database server is hosted on the same machine as the ; asterisk server, you can achieve a local Unix socket connection by ; setting hostname=localhost ; ; port and sock are both optional parameters. If hostname is specified ; and is not "localhost", then cdr_mysql will attempt to connect to the ; port specified or use the default port. If hostname is not specified ; or if hostname is "localhost", then cdr_mysql will attempt to connect ; to the socket file specified by sock or otherwise use the default socket ; file. ; [global] hostname=localhost dbname=asteriskcdrdb password=****** user=asteriskcdruser ;port=3306 ;sock=/tmp/mysql.sock sock=/var/lib/mysql/mysql.sock srwxrwxrwx 1 mysql mysql 0 Feb 2 19:37 /var/lib/mysql/mysql.sock Tomica -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Tilghman Lesher Sent: Tuesday, February 03, 2004 12:32 AM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] cdr mysql problem On Monday 02 February 2004 15:27, Tomica Crnek wrote:> Yes, I have checked the logs. There is nothing there. I think asterisk> doesn't try to connect.Please paste the contents of /etc/asterisk/cdr_mysql.conf. Also, paste the output of: ls -l /tmp/mysql.sock /var/lib/mysql/mysql.sock ; locate mysql.sock -Tilghman _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com Buy The Best In BOOKS at http://www.bestsellers.indiatimes.com Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to http://airsahara.indiatimes.com and Bid Now!
On Tuesday 03 February 2004 01:44, Tomica Crnek wrote:> [global] > hostname=localhost > dbname=asteriskcdrdb > password=****** > user=asteriskcdruser > ;port=3306 > ;sock=/tmp/mysql.sock > sock=/var/lib/mysql/mysql.sockOkay, and so does this work? bash$ echo "select max(calldate) from cdr;" | \> mysql -uasteriskcdruser -S/var/lib/mysql/mysql.sock \ > -p asteriskcdrdbEnter password: max(calldate) 2004-02-02 19:19:22 bash$ -Tilghman
Thanks, I don't know what is different from all steps I have followed several times. I did all this before, believe me. Now, I said to myself that I'll do it once again, and it worked. Thanks once again! Tomica -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of dipak0105 Sent: Tuesday, February 03, 2004 1:47 PM To: asterisk-users@lists.digium.com Subject: Re: RE: [Asterisk-Users] cdr mysql problem Hi You have to follow this steps and obviously you got success because we have followed this steps and got success. Configure the cdr_mysql.conf file in the location /etc/asterisk. The configuration is as follows: [global] hostname=localhost ;This is the host name of MySql dbname=asteriskcdrdb ;This is the database name of MySql password=password ;This is the password of user user=asteriskcdruser ;This is the user in MySql port=3306 ;This is the port number running the MySql sock=/var/lib/mysql/mysql.sock ;This is the socket of MySql and the location Then follow the steps in the MySql server 1. Go to Start Application>>System>>Service Configuration. Check the mysqld box. Click the save button Then click the start button. 2. Open a kolsole. 3. Type: "mysql -u root" to enter into mysql. 4. Type: "SET PASSWORD FOR root = PASSWORD("password");" for setting the root password. 5. Type: "GRANT ALL PRIVILEGES ON *.* TO asteriskcdruser@localhost IDENTIFIED BY "password" WITH GRANT OPTION;" 6. Type: "\q;" to Quit mysql. 7. Type: In konsole "mysql -u asteriskcdruser -p" and use the password "password", to reenter mysql as "asteriskcdruser" user. 8. Type: "CREATE DATABASE asteriskcdrdb;" 9. Type: "CREATE TABLE cdr ( calldate datetime NOT NULL default '0000-00-00 00:00:00', clid varchar(45) NOT NULL default '', src varchar(45) NOT NULL default '', dst varchar(45) NOT NULL default '', dcontext varchar(45) NOT NULL default '', channel varchar(45) NOT NULL default '', dstchannel varchar(45) NOT NULL default '', lastapp varchar(45) NOT NULL default '', lastdata varchar(45) NOT NULL default '', duration int(11) NOT NULL default '0', billsec int(11) NOT NULL default '0', disposition varchar(45) NOT NULL default '', amaflags int(11) NOT NULL default '0', accountcode varchar(45) NOT NULL default '', uniqueid varchar(45) NOT NULL default '' );" for create a table "cdr". 10. To reload the configuration, type reload from the Asterisk command prompt. These are the steps of Configuration of MySql with Asterisk server. Contact me if you need any further clarifications. Dipak Kumar Paul. Sigmabit Technology India. asterisk-users@lists.digium.com wrote: Hi, here it is... [root@ceres asterisk]# cat cdr_mysql.conf ; ; Note - if the database server is hosted on the same machine as the ; asterisk server, you can achieve a local Unix socket connection by ; setting hostname=localhost ; ; port and sock are both optional parameters. If hostname is specified ; and is not "localhost", then cdr_mysql will attempt to connect to the ; port specified or use the default port. If hostname is not specified ; or if hostname is "localhost", then cdr_mysql will attempt to connect ; to the socket file specified by sock or otherwise use the default socket ; file. ; [global] hostname=localhost dbname=asteriskcdrdb password=****** user=asteriskcdruser ;port=3306 ;sock=/tmp/mysql.sock sock=/var/lib/mysql/mysql.sock srwxrwxrwx 1 mysql mysql 0 Feb 2 19:37 /var/lib/mysql/mysql.sock Tomica -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Tilghman Lesher Sent: Tuesday, February 03, 2004 12:32 AM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] cdr mysql problem On Monday 02 February 2004 15:27, Tomica Crnek wrote:> Yes, I have checked the logs. There is nothing there. I think asterisk> doesn't try to connect.Please paste the contents of /etc/asterisk/cdr_mysql.conf. Also, paste the output of: ls -l /tmp/mysql.sock /var/lib/mysql/mysql.sock ; locate mysql.sock -Tilghman _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com Buy The Best In BOOKS at http://www.bestsellers.indiatimes.com Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to http://airsahara.indiatimes.com and Bid Now! _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Dear folks, I've just compiled asterisk-addon1.2.1 after installing MySQL and MySQl-devel packages. and adjust my cdr_mysql.conf to use the defined database using username and password. But as soon as starting asterisk i get error messages informing me of error, error message is as follows : cdr_addon_mysql.c : Failed to connect mysql database cdr on localhost" and "res_config_mysql.c : Failed to connect database server on ." Im realy lost and dont know whats wrong. I've checked the connection to MySql in command line using the same user and host and its been connected without any problem. Anyone has any idea whats wrong here. Regards. --- M. Shokuie Nia. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/