sock=/tmp/mysql.sock<br><br>Is this path for socket correct ?<br>In some distro it is /var/lib/mysql/mysql.sock . Type "locate mysql.sock" in shell . Also remove uncomment port=3306 if using socket to connect .
<br><br><div><span class="gmail_quote">On 07/08/07, <b class="gmail_sendername">Alessandro Russo</b> <<a href="mailto:ax.russo@gmail.com">ax.russo@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, try to login as asteriskcdruser to mysql<br>------------------------------------------------------------------------------------------------------------<br># mysql -u asteriskcdruser -p<br>Enter password: password<span class="q">
<br>Welcome to the MySQL monitor. Commands end with ; or \g.
<br></span>Your MySQL connection id is 12<br>Server version: 5.0.32-Debian_7etch1-log Debian etch distribution<span class="q"><br><br>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br>
<br>mysql> <br><br></span>
------------------------------------------------------------------------------------------------------------<br>Can you login with asteriskcdruser?<br>If you cannot login there are some problems with privileges or...I don't know :(
<div><span class="e" id="q_11440f5d8b290fe5_5"><br><br><br><div><span class="gmail_quote">On 8/7/07, <b class="gmail_sendername">Adrian Marsh</b> <<a href="mailto:Adrian.Marsh@ubiquisys.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Adrian.Marsh@ubiquisys.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="blue" lang="EN-US">
<div>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Alessandro,</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks for that.. I'm pretty sure
about the user. I used Webmin to confirm the user configs, but I ran your
commands anyway:</span></font></p><span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">mysql> use mysql ;</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Reading table information for completion
of table and column names</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">You can turn off this feature to get a
quicker startup with -A</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Database changed</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">mysql> select Host from user where User
= 'asteriskcdruser' ;</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">+-----------+</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">| Host |</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">+-----------+</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">| localhost |</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">+-----------+</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">1 row in set (0.00 sec)</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p></span><span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">mysql> grant insert on asteriskcdrdb.*
to asteriskcdruser@localhost identified by 'asteriskcdruser';</span></font></p></span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Query OK, 0 rows affected (0.00 sec)</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">But I still get the failure:</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">[Aug 7 15:14:10] ERROR[29103]:
cdr_addon_mysql.c:436 my_load_module: Failed to connect to mysql database
asteriskcdrdb on localhost.</span></font></p><span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">cdr_addon_mysql.so => (MySQL CDR
Backend)</span></font></p></span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">[Aug 7 15:14:10] ERROR[29103]:
res_config_mysql.c:627 mysql_reconnect: MySQL RealTime: Failed to connect
database server on (err 2002). Check debug for more info.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">[Aug 7 15:14:10] WARNING[29103]:
res_config_mysql.c:474 load_module: MySQL RealTime: Couldn't establish
connection. Check debug.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">[Aug 7 15:14:10] NOTICE[29103]:
config.c:1171 ast_config_engine_register: Registered Config Engine mysql</span></font></p><span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">MySQL RealTime driver loaded.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">res_config_mysql.so => (MySQL RealTime
Configuration Driver)</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p></span>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">This box also das Cacti installed on it,
which makes use of the MySql server as well (and all is ok there).</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<div>
<p><span><font color="#003366" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: rgb(0, 51, 102);">Adrian Marsh</span></font></span><font color="navy"><span style="color: navy;"></span></font>
</p>
<p><font color="navy" face="Times New Roman" size="3"><span style="font-size: 12pt; color: navy;"> </span></font><span><font color="#003366" face="Arial Narrow" size="2"><span style="font-size: 10pt; color: rgb(0, 51, 102);">
</span></font></span><span><font color="#003366" face="Arial Narrow" size="2"><span style="font-size: 10pt; color: rgb(0, 51, 102);"></span></font></span></p>
</div>
<div>
<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<hr align="center" size="2" width="100%">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
asterisk-users-bounces@lists.digium.com</a>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">asterisk-users-bounces@lists.digium.com</a>] <b><span style="font-weight: bold;">On Behalf Of
</span></b>Alessandro Russo<br>
<b><span style="font-weight: bold;">Sent:</span></b> 07 August 2007 14:13<div><span><br>
<b><span style="font-weight: bold;">To:</span></b> Asterisk
Users Mailing List - Non-Commercial Discussion<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [asterisk-users]
CDR/MySQL basic config</span></div></span></font></p>
</div><div><span>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi, <br>
first step is correct </span></font></p>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;">
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hmm.. This is what I get:<br>
<br>
[root@ubiq-serv6 ~]# mysql -u root -p<br>
Enter password:<br>
Welcome to the MySQL monitor. Commands end with ; or \g.<br>
Your MySQL connection id is 187143 to server version: 4.1.20<br>
<br>
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. </span></font></p>
</blockquote>
<blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;">
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">You make an errore here : mysql> use asteriskcdrdb </span></font></p>
</blockquote>
<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">users' information are
stored in mysql db<br>
<br>
mysql> use mysql;<br>
Reading table information for completion of table and column names<br>
You can turn off this feature to get a quicker startup with -A<br>
<br>
Database changed <br>
mysql
<br>
<br>
mysql> select Host from user where User = 'asteriskcdruser' ;<br>
+-----------+<br>
| Host |<br>
+-----------+<br>
| localhost |<br>
+-----------+<br>
1 row in set (0.00 sec)<br>
<br>
mysql> <br>
<br>
Are you sure that user 'asteriskcdruser' has the privileges to insert record in
DB "asteriskcdrdb"?<br>
If not...allow 'asteriskcdruser' to insert record ^_^<br>
<br>
mysql> grant insert on asteriskcdrdb.* to asteriskcdruser@localhost
identified by 'asteriskcdruser';<br>
mysql> exit<br>
<br>
Reload asterisk and try <br>
<br>
<br>
</span></font></p>
<div>
<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">On 8/7/07, <b><span style="font-weight: bold;">Adrian Marsh</span></b> < <a href="mailto:Adrian.Marsh@ubiquisys.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Adrian.Marsh@ubiquisys.com</a>>
wrote:</span></font></span></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
Hmm.. This is what I get:<br>
<br>
[root@ubiq-serv6 ~]# mysql -u root -p<br>
Enter password:<br>
Welcome to the MySQL monitor. Commands end with ; or \g.<br>
Your MySQL connection id is 187143 to server version: 4.1.20<br>
<br>
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br>
<br>
mysql> use asteriskcdrdb ;<br>
Reading table information for completion of table and column names<br>
You can turn off this feature to get a quicker startup with -A <br>
<br>
Database changed<br>
mysql> select Host from user where User = 'asteriskcdruser' ;<br>
ERROR 1146 (42S02): Table 'asteriskcdrdb.user' doesn't exist<br>
mysql><br>
<br>
<br>
Adrian Marsh<br>
-----Original Message----- <br>
From: <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">asterisk-users-bounces@lists.digium.com</a><br>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">asterisk-users-bounces@lists.digium.com</a>
] On Behalf Of Forrest<br>
Beck<br>
Sent: 07 August 2007 02:59<br>
To: Asterisk Users Mailing List - Non-Commercial
Discussion<br>
Subject: Re: [asterisk-users] CDR/MySQL basic config<br>
<br>
Adrian,<br>
<br>
What host/ip did you specify when you created the user? <br>
<br>
#> mysql --user=root --password<br>
<br>
#mysql> use mysql;<br>
<br>
#mysql> select Host from user where User = 'asteriskcdruser'<br>
(this line is case sensitive)<br>
<br>
Does it return <a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">127.0.0.1</a> or
localhost. Make cdr_mysql reflect that.<br>
<br>
You should also check out cdr_odbc, asterisk can connect through an<br>
ODBC connection which in turn is a connection to the MySQL database.<br>
There seems to be more suport for the ODBC driver. <br>
<br>
Hope this helps some....<br>
<br>
<br>
<br>
On 8/6/07, Adrian Marsh <<a href="mailto:Adrian.Marsh@ubiquisys.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Adrian.Marsh@ubiquisys.com</a>>
wrote:<br>
> Hi,<br>
><br>
> I'm trying to add mysql CDR onto a vanilla Asterisk 1.2
install. The<br>
> add-ons pack has been installed for a while, so now I'm trying to add<br>
> the Mysql config.<br>
><br>
> I've created a mysql database, added the grants for a user acces, and<br>
> can run a mysql -u asteriskcdruser -p and can connect to the database. <br>
><br>
> I've been using this as a guide:<br>
><br>
<a href="http://www.757.org/%7Ejoat/wiki/index.php/Asterisk#Viewing_CDR_Data_with_A" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.757.org/~joat/wiki/index.php/Asterisk#Viewing_CDR_Data_with_A
</a>
<br>
> sterisk:_CDR_Analyzer<br>
><br>
> I've created cdr_mysql.conf:<br>
><br>
> [global]<br>
> hostname=localhost<br>
> dbname=asteriskcdrdb<br>
> table=cdr<br>
> password=password<br>
> user=asteriskcdruser <br>
> port=3306<br>
> sock=/tmp/mysql.sock<br>
> userfield=1<br>
><br>
> But when I start asterisk (1.4 on my test machine), I get:<br>
><br>
> == Parsing '/etc/asterisk/cdr_mysql.conf': Found<br>
> [Aug 6 21:01:14] ERROR[32512]: cdr_addon_mysql.c:436
my_load_module:<br>
> Failed to connect to mysql database asteriskcdrdb on localhost.<br>
> cdr_addon_mysql.so => (MySQL CDR Backend)<br>
> [Aug 6 21:01:14] ERROR[32512]: res_config_mysql.c:627 <br>
mysql_reconnect:<br>
> MySQL RealTime: Failed to connect database
server on (err 2002).<br>
Check<br>
> debug for more info.<br>
> [Aug 6 21:01:14] WARNING[32512]: res_config_mysql.c:474
load_module:<br>
> MySQL RealTime: Couldn't establish connection. Check debug. <br>
> [Aug 6 21:01:14] NOTICE[32512]: config.c:1171<br>
> ast_config_engine_register: Registered Config Engine mysql<br>
> MySQL RealTime driver loaded.<br>
> res_config_mysql.so => (MySQL RealTime Configuration Driver) <br>
><br>
><br>
> I'm also looking as to what CDR viewers there are available, and which<br>
> people think are best. I want to view/report on the calls made
within<br>
> A*k.<br>
><br>
> Thanks,<br>
> <br>
> Adrian<br>
><br>
> _______________________________________________<br>
> --Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.api-digital.com--</a><br>
><br>
> asterisk-users mailing list <br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
<br>
<br>
--<br>
***<br>
Forrest Beck <br>
IAXTEL: 17002871718<br>
<a href="mailto:jonforrest.beck@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jonforrest.beck@gmail.com</a><br>
<a href="http://www.shift8.biz" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.shift8.biz</a><br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.api-digital.com--</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.api-digital.com--
</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.digium.com/mailman/listinfo/asterisk-users</a></span></font></p>
</div>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
<br clear="all">
<br>
-- <br>
<br>
Alessandro R. </span></font></p>
</span></div></div>
</div>
<br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.api-digital.com--
</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><br> Alessandro R.
</span></div><br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.api-digital.com--" target="_blank">http://www.api-digital.com--
</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>