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

osiris123d duane.larson at gmail.com
Wed Jun 1 21:05:01 CEST 2011


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.



More information about the Users mailing list