[OpenSIPS-Users] CDRTool - MySQL Database error: Invalid SQL:

Adrian Georgescu ag at ag-projects.com
Wed Jun 1 21:14:59 CEST 2011


Seems to be a php bug that cannot correctly identify the different connections in a mysql pool. Work around it by using different credentials/database combinations.

Adrian

On Jun 1, 2011, at 9:05 PM, osiris123d wrote:

> Figured out the issue but it doesn't make sense.  From my last post it
> appeared that when mysql was querying for the radacct201106 table it was
> looking in the cdrtool database.  Well when I set up cdrtool's global.inc
> config I made it so that cdradmin mysql user was used to log into the
> cdrtool database and also the radius database.  Here is an example of what I
> had
> 
> class DB_CDRTool extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "cdrtool";
>  var $User     = "cdradmin";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_Locker extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "cdrtool";
>  var $User     = "locker";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_radius extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "radius";
>  var $User     = "cdradmin";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_opensips extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "opensips";
>  var $User     = "opensips";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_mediaproxy extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "mediaproxy";
>  var $User     = "cdradmin";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> 
> 
> 
> Originally I had the radius database user as "radius", but when I tried to
> create that user in mysql it wouldn't let me (maybe because there is a
> database called radius, not sure).  So I figured I would just use the
> cdradmin user for everything except for opensips database.  Well when I
> changed the cdrtool config to the following it is now about to do CDR
> searches
> 
> 
> class DB_CDRTool extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "cdrtool";
>  var $User     = "cdradmin";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_Locker extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "cdrtool";
>  var $User     = "locker";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_radius extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "radius";
>  var $User     = "radadmin";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_opensips extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "opensips";
>  var $User     = "opensips";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> }
> 
> class DB_mediaproxy extends DB_Sql {
>  var $Host     = "127.0.0.1";
>  var $Database = "mediaproxy";
>  var $User     = "cdradmin";
>  var $Password = "*";
>  var $Halt_On_Error ="yes";
> 
> 
> So it all appears to be good now, but I figured I should have still been
> able to use the cdradmin user for both databases.  For some reason CDRTool
> was looking in the cdrtool database for the radacct201106.
> 
> 
> 
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/CDRTool-MySQL-Database-error-Invalid-SQL-tp6427865p6428379.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 




More information about the Users mailing list