Jonas Kellens | 24 Jan 16:43 2011
Picon

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' <at> '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' <at> '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-users
bakko | 24 Jan 16:53 2011
Picon

Re: Unable to insert cdr-data into mysql-DB

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
--
_____________________________________________________________________
-- 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-users
Marius Pedersen | 24 Jan 16:59 2011
Picon
Picon

Re: 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' <at> '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' <at> '127.0.0.1';
> 
[snip]

Grant rights to 'asteriskcdr' <at> 'localhost' instead of  <at> '127.0.0.1'? (re 
the error message above)

Regards,
Marius

--
_____________________________________________________________________
-- 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-users

Bruce Ferrell | 24 Jan 17:24 2011

Re: 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' <at> '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' <at> '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-users
redo your grant like this:

GRANT SELECT , INSERT ,UPDATE ON `Asterisk`.`cdr` TO
'asteriskcdr' <at> '127.0.0.1' IDENTIFIED by 'mysecret';

follow it with:

flush privileges;

--
_____________________________________________________________________
-- 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-users

Andrew Thomas | 25 Jan 10:36 2011
Picon

Re: 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' <at> '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' <at> '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' <at> '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.

--
_____________________________________________________________________
-- 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-users

Steve Howes | 25 Jan 11:26 2011
Picon

Re: Unable to insert cdr-data into mysql-DB

On 25 Jan 2011, at 09:36, Andrew Thomas wrote:
> 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>.

I believe localhost means it can use a socket, where as 127.0.0.1 forces IP.

S

--
_____________________________________________________________________
-- 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-users

Enrico Cicconi | 25 Jan 10:51 2011
Picon

Re: 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' <at> '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' <at> '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-users
Hi, 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' <at> '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
--
_____________________________________________________________________
-- 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-users
A J Stiles | 25 Jan 12:59 2011
Picon

Re: Unable to insert cdr-data into mysql-DB

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' <at> '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 <at> "%" 
IDENTIFIED BY "mysecret";

--

-- 
AJS

Answers come *after* questions.

--
_____________________________________________________________________
-- 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-users


Gmane