Jonas Kellens
2011-Jan-24 15:43 UTC
[asterisk-users] Unable to insert cdr-data into mysql-DB
Hello list, I keep on getting the error : ERROR[1707] cdr_addon_mysql.c: Cannot connect to database server 127.0.0.1: (1045) Access denied for user 'asteriskcdr'@'localhost' (using password: YES) I have a 'cdr' table in my MySQL-DB. On this table the user 'asteriskcdr' has select, insert, update privileges. GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO 'asteriskcdr'@'127.0.0.1'; cdr_mysql.conf : [global] hostname=127.0.0.1 dbname=Asterisk table=cdr password=mysecret user=asteriskcdr port=3306 sock=/tmp/mysql.sock userfield=1 I really don't know why Asterisk cannot connect to the table.. Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110124/d0e7c15f/attachment.htm>
Hi, maybe the error is on this line: sock=/tmp/mysql.sock if you use CentOS the correct line is: sock=/var/lib/mysql/mysql.sock if you use Debian/ubuntu: sock=/var/run/mysqld/mysqld.sock Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110124/176d0992/attachment.htm>
Marius Pedersen
2011-Jan-24 15:59 UTC
[asterisk-users] Unable to insert cdr-data into mysql-DB
Jonas Kellens wrote:> Hello list, > > I keep on getting the error : > > ERROR[1707] cdr_addon_mysql.c: Cannot connect to database server > 127.0.0.1: (1045) Access denied for user 'asteriskcdr'@'localhost' > (using password: YES) > > > I have a 'cdr' table in my MySQL-DB. On this table the user > 'asteriskcdr' has select, insert, update privileges. > > GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO > 'asteriskcdr'@'127.0.0.1'; >[snip] Grant rights to 'asteriskcdr'@'localhost' instead of @'127.0.0.1'? (re the error message above) Regards, Marius
Bruce Ferrell
2011-Jan-24 16:24 UTC
[asterisk-users] Unable to insert cdr-data into mysql-DB
On 01/24/2011 07:43 AM, Jonas Kellens wrote:> Hello list, > > I keep on getting the error : > > ERROR[1707] cdr_addon_mysql.c: Cannot connect to database server > 127.0.0.1: (1045) Access denied for user 'asteriskcdr'@'localhost' > (using password: YES) > > > I have a 'cdr' table in my MySQL-DB. On this table the user > 'asteriskcdr' has select, insert, update privileges. > > GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO > 'asteriskcdr'@'127.0.0.1'; > > > cdr_mysql.conf : > > [global] > hostname=127.0.0.1 > dbname=Asterisk > table=cdr > password=mysecret > user=asteriskcdr > port=3306 > sock=/tmp/mysql.sock > userfield=1 > > I really don't know why Asterisk cannot connect to the table.. > > > Kind regards, > Jonas. > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersredo your grant like this: GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO 'asteriskcdr'@'127.0.0.1' IDENTIFIED by 'mysecret'; follow it with: flush privileges;
Andrew Thomas
2011-Jan-25 09:36 UTC
[asterisk-users] Unable to insert cdr-data into mysql-DB
Try changing 'hostname=127.0.0.1' to 'hostname=localhost' in the cdr_mysql.conf. I seem to remember a problem I had when '127.0.0.1' and 'localhost' didn't marry up <never did find out why>. If that doesn't work - try "GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO 'asteriskcdr'@'localhost';" instead. HTH -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens Sent: 24 January 2011 15:44 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Unable to insert cdr-data into mysql-DB Hello list, I keep on getting the error : ERROR[1707] cdr_addon_mysql.c: Cannot connect to database server 127.0.0.1: (1045) Access denied for user 'asteriskcdr'@'localhost' (using password: YES) I have a 'cdr' table in my MySQL-DB. On this table the user 'asteriskcdr' has select, insert, update privileges. GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO 'asteriskcdr'@'127.0.0.1'; cdr_mysql.conf : [global] hostname=127.0.0.1 dbname=Asterisk table=cdr password=mysecret user=asteriskcdr port=3306 sock=/tmp/mysql.sock userfield=1 I really don't know why Asterisk cannot connect to the table.. Kind regards, Jonas. If you have received this communication in error we would appreciate you advising us either by telephone or return of e-mail. The contents of this message, and any attachments, are the property of DataVox, and are intended for the confidential use of the named recipient only. If you are not the intended recipient, employee or agent responsible for delivery of this message to the intended recipient, take note that any dissemination, distribution or copying of this communication and its attachments is strictly prohibited, and may be subject to civil or criminal action for which you may be liable. Every effort has been made to ensure that this e-mail or any attachments are free from viruses. While the company has taken every reasonable precaution to minimise this risk, neither company, nor the sender can accept liability for any damage which you sustain as a result of viruses. It is recommended that you should carry out your own virus checks before opening any attachments. Registered in England. No. 27459085.
Enrico Cicconi
2011-Jan-25 09:51 UTC
[asterisk-users] Unable to insert cdr-data into mysql-DB
Il 24/01/2011 16:43, Jonas Kellens ha scritto:> Hello list, > > I keep on getting the error : > > ERROR[1707] cdr_addon_mysql.c: Cannot connect to database server > 127.0.0.1: (1045) Access denied for user 'asteriskcdr'@'localhost' > (using password: YES) > > > I have a 'cdr' table in my MySQL-DB. On this table the user > 'asteriskcdr' has select, insert, update privileges. > > GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO > 'asteriskcdr'@'127.0.0.1'; > > > cdr_mysql.conf : > > [global] > hostname=127.0.0.1 > dbname=Asterisk > table=cdr > password=mysecret > user=asteriskcdr > port=3306 > sock=/tmp/mysql.sock > userfield=1 > > I really don't know why Asterisk cannot connect to the table.. > > > Kind regards, > Jonas. > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersHi, try to do as follow. (sorry for my english) From server console Connect to mysql with admin privileges --> i.e. command: mysql -uroot -pyourpassword change db to asterisk --> command: use asterisk; define for your user the right password --> command: SET PASSWORD FOR 'asteriskcdr'@'localhost' = PASSWORD('mypassword'); disconnect from mysql and reconnect with asteriskcdr user so to verify that user grant and access are ok. If the user configuration is ok but there are still problems you can now check in other direction. If not you solved your problem Please let me know if I had help you. Have a nice evening Enrico -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110125/e6f8e330/attachment.htm>
On Monday 24 Jan 2011, Jonas Kellens wrote:> I keep on getting the error : > > ERROR[1707] cdr_addon_mysql.c: Cannot connect to database server > 127.0.0.1: (1045) Access denied for user 'asteriskcdr'@'localhost' > (using password: YES) > > [stuff deleted]Try "hostname=localhost" aot "hostname=127.0.0.1", and make sure the socket you specified actually exists. (On Debian and Ubuntu, it should be "sock=/var/run/mysqld/mysqld.sock".) Also, are you sure you gave the user the right password? Try GRANT ALL ON Asterisk.cdr TO asteriskcdr@"%" IDENTIFIED BY "mysecret"; -- AJS Answers come *after* questions.