3.6.2. DBSource Previous topic Parent topic Child topic Next topic

This parameter is used by Perl DBI to specify the database driver and database system to connect to. It usually begins with dbi:drivername:. There is no standard for the text following the driver name, consult the details for your DBD driver. You can use any of the special characters described in Section 3.1. Special characters. Some examples are given below.
# Connect to MySQL database called radius. Typically defaults to Unix socket
DBSource dbi:mysql:database=radius

# Or... Use SQLIte file called users.db located in the DbDir directory
DBSource dbi:SQLite:%D/users.db

# Or... Connect to the Oracle SID called users
DBSource dbi:Oracle:users

# Or... Connect to PostgreSQL database called radius on localhost, default port
DBSource dbi:Pg:dbname=radius;host=127.0.0.1
Tip
For some applications, it is useful to use a GlobalVar to specify the name of the SQL database. That way your Radiator can be parameterised from the command line:
DBSource dbi:mysql:%{GlobalVar:databasename}
radiusd -config_file xxxxxx.cfg databasename=radius