Why Freeradius and Mysql dont work?

Markus Krause krause at biochem.mpg.de
Sun Jan 28 16:17:16 CET 2007


Zitat von yao guoxian <yaoguoxian at gmail.com>:

>   Platform and Environment:
>   Freeradius:1.0.5  on Redhat 9
>   MySQL:MySQL-standard-5.0.20-linux-i686
>   Step:
>   1. create database radius;
>   2.mysql -uroot -prootpass radius < db_mysql.sql ;
>   3.Edit radiusd.conf and sql.conf;
>   Debug Result:
>   Nothing to do.  Sleeping until we see a request.
> rad_recv: Access-Request packet from host 202.117.7.223:1490, id=6,
> length=47
>        User-Name = "barney"
>        CHAP-Password = 0xad35a90d409c25b78b6d148a531358d9ac
>  Processing the authorize section of radiusd.conf
> modcall: entering group authorize for request 2
>  modcall[authorize]: module "preprocess" returns ok for request 2
>  rlm_chap: Setting 'Auth-Type := CHAP'
>  modcall[authorize]: module "chap" returns ok for request 2
>  modcall[authorize]: module "mschap" returns noop for request 2
>    rlm_realm: No '@' in User-Name = "barney", looking up realm NULL
>    rlm_realm: No such realm "NULL"
>  modcall[authorize]: module "suffix" returns noop for request 2
> radius_xlat:  'barney'
> rlm_sql (sql): sql_set_user escaped user --> 'barney'
> radius_xlat:  'SELECT id, UserName, Attribute, Value, op           FROM
> radcheck           WHERE Username = 'barney'           ORDER BY id'
> rlm_sql (sql): Ignoring unconnected handle 4..
> rlm_sql (sql): Ignoring unconnected handle 3..
> rlm_sql (sql): Ignoring unconnected handle 2..
> rlm_sql (sql): Ignoring unconnected handle 1..
> rlm_sql (sql): Ignoring unconnected handle 0..
> rlm_sql (sql): There are no DB handles to use! skipped 5, tried to connect 0
>  modcall[authorize]: module "sql" returns fail for request 2
> modcall: group authorize returns fail for request 2
> Finished request 2
> Going to the next request
> --- Walking the entire request list ---
> Waking up in 6 seconds...
> rad_recv: Access-Request packet from host 202.117.7.223:1490, id=6,
> length=47
> Discarding duplicate request from client liv1:1490 - ID: 6
> --- Walking the entire request list ---
> Waking up in 2 seconds...
> --- Walking the entire request list ---
> Cleaning up request 2 ID 6 with timestamp 45bca7cb
> Nothing to do.  Sleeping until we see a request.
>
>   From the above results, I guess mysql doesnt work. But I can access
> databases from the command line .The Freeradius Server worked well when I
> use the "user", not using MySQL.
>  Any suggestion?

Did you double-check the settings in sql.conf? It seems that  
freeradius can not connect to the mysql server.
The startup messages (in debug mode) at my installation has the lines:

  sql: safe-characters =  
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to radiusd at localhost:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql_mysql: Starting connect to MySQL server for #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_mysql #1
rlm_sql_mysql: Starting connect to MySQL server for #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_mysql #2
rlm_sql_mysql: Starting connect to MySQL server for #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_mysql #3
rlm_sql_mysql: Starting connect to MySQL server for #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_mysql #4
rlm_sql_mysql: Starting connect to MySQL server for #4
rlm_sql (sql): Connected new DB handle, #4
Module: Instantiated sql (sql)

Do you see those?

Regards
    markus


-- 
Markus Krause                                   email: krause at biochem.mpg.de
Mogli-Soft: Support for Mac OS X, Webmail/Horde, LDAP, RADIUS
by order of the Computing Center of the Max-Planck-Institute of Biochemistry
Tel.: 089 - 89 40 85 99                         Fax.: 089 - 89 40 85 98

----------------------------------------------------------------------
      This message was sent using https://webmail2.biochem.mpg.de
If you encounter any problems please report to rz-linux at biochem.mpg.de






More information about the Freeradius-Users mailing list