Hey, In my FR1.1.7 setup, I have different realms for the same machine using different databases for each. The login part is ok, as well as the accounting, which has entries in the radacct table for "account". I enabled one of the sql counters modules which, as it seems, isn't returning any results, because I am suspecting that it's running the query on another realm's database. I have several of the sql.conf config files for each realm, so what I'm basically doing is having in accounting {} section something like this: Acct-Type SQL_EXAMPLE { sql_example } What do you think is happening? Here is the relevant debug snippet from freeradius: Wed May 6 22:47:28 2009 : Debug: modsingle[authorize]: calling accessperiod (rlm_sqlcounter) for request 0 Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: Entering module authorize code Wed May 6 22:47:28 2009 : Debug: sqlcounter_expand: 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '%{Stripped-User-Name:-%{User-Name}}' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: radius_xlat: 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: sqlcounter_expand: '%{sql:SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1}' Wed May 6 22:47:28 2009 : Debug: radius_xlat: Running registered xlat function of module sql for string 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): - sql_xlat Wed May 6 22:47:28 2009 : Debug: radius_xlat: 'access1' Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): sql_set_user escaped user --> 'access1' Wed May 6 22:47:28 2009 : Debug: radius_xlat: 'SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = 'access1' ORDER BY AcctStartTime LIMIT 1' Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): Reserving sql socket id: 2 Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): SQL query did not return any results Wed May 6 22:47:28 2009 : Debug: rlm_sql (sql): Released sql socket id: 2 Wed May 6 22:47:28 2009 : Debug: radius_xlat: '' Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: (Check item - counter) is greater than zero Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: Authorized user access1, check_item=300, counter=0 Wed May 6 22:47:28 2009 : Debug: rlm_sqlcounter: Sent Reply-Item for user access1, Type=Session-Timeout, value=300 Wed May 6 22:47:28 2009 : Debug: modsingle[authorize]: returned from accessperiod (rlm_sqlcounter) for request 0 Wed May 6 22:47:28 2009 : Debug: modcall[authorize]: module "accessperiod" returns ok for request 0 Regards, Liran.