1 ###########################################################################
2 # db_mysql.sql rlm_sql - FreeRADIUS SQL Module #
4 # Database schema for MySQL rlm_sql module #
7 # mysql -uroot -prootpass radius < db_mysql.sql #
9 # Mike Machado <mike@innercite.com> #
10 ###########################################################################
13 # Host: localhost Database: radius
14 #--------------------------------------------------------
17 # Table structure for table 'dictionary'
19 CREATE TABLE dictionary (
20 id int(10) DEFAULT '0' NOT NULL auto_increment,
22 Attribute varchar(32),
30 # Table structure for table 'nas'
33 id int(10) DEFAULT '0' NOT NULL auto_increment,
35 shortname varchar(32),
40 community varchar(50),
46 # Table structure for table 'radacct'
48 CREATE TABLE radacct (
49 RadAcctId bigint(21) DEFAULT '0' NOT NULL auto_increment,
50 AcctSessionId varchar(32) DEFAULT '' NOT NULL,
51 AcctUniqueId varchar(32) DEFAULT '' NOT NULL,
52 UserName varchar(32) DEFAULT '' NOT NULL,
53 Realm varchar(30) DEFAULT '',
54 NASIPAddress varchar(15) DEFAULT '' NOT NULL,
56 NASPortType varchar(32),
57 AcctStartTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
58 AcctStopTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
59 AcctSessionTime int(12),
60 AcctAuthentic varchar(32),
61 ConnectInfo_start varchar(32),
62 ConnectInfo_stop varchar(32),
63 AcctInputOctets int(12),
64 AcctOutputOctets int(12),
65 CalledStationId varchar(10) DEFAULT '' NOT NULL,
66 CallingStationId varchar(10) DEFAULT '' NOT NULL,
67 AcctTerminateCause varchar(32) DEFAULT '' NOT NULL,
68 ServiceType varchar(32),
69 FramedProtocol varchar(32),
70 FramedIPAddress varchar(15) DEFAULT '' NOT NULL,
71 AcctStartDelay int(12),
72 AcctStopDelay int(12),
73 PRIMARY KEY (RadAcctId),
74 KEY UserName (UserName),
75 KEY FramedIPAddress (FramedIPAddress),
76 KEY AcctSessionId (AcctSessionId),
77 KEY AcctUniqueId (AcctUniqueId),
78 KEY AcctStartTime (AcctStartTime),
79 KEY AcctStopTime (AcctStopTime),
80 KEY NASIPAddress (NASIPAddress)
84 # Table structure for table 'radcheck'
86 CREATE TABLE radcheck (
87 id int(10) DEFAULT '0' NOT NULL auto_increment,
88 UserName varchar(30) DEFAULT '' NOT NULL,
89 Attribute varchar(30),
93 KEY UserName (UserName)
97 # Table structure for table 'radgroupcheck'
99 CREATE TABLE radgroupcheck (
100 id int(10) DEFAULT '0' NOT NULL auto_increment,
101 GroupName varchar(20) DEFAULT '' NOT NULL,
102 Attribute varchar(40),
106 KEY GroupName (GroupName)
110 # Table structure for table 'radgroupreply'
112 CREATE TABLE radgroupreply (
113 id int(10) DEFAULT '0' NOT NULL auto_increment,
114 GroupName varchar(20) DEFAULT '' NOT NULL,
115 Attribute varchar(40),
119 KEY GroupName (GroupName)
123 # Table structure for table 'radreply'
125 CREATE TABLE radreply (
126 id int(10) DEFAULT '0' NOT NULL auto_increment,
127 UserName varchar(30) DEFAULT '' NOT NULL,
128 Attribute varchar(30),
132 KEY UserName (UserName)
136 # Table structure for table 'usergroup'
138 CREATE TABLE usergroup (
139 id int(10) DEFAULT '0' NOT NULL auto_increment,
140 UserName varchar(30) DEFAULT '' NOT NULL,
141 GroupName varchar(30),
143 KEY UserName (UserName)
147 # Table structure for table 'realmgroup'
149 CREATE TABLE realmgroup (
150 id int(10) DEFAULT '0' NOT NULL auto_increment,
151 RealmName varchar(30) DEFAULT '' NOT NULL,
152 GroupName varchar(30),
154 KEY RealmName (RealmName)
157 CREATE TABLE realms (
158 id int(10) DEFAULT '0' NOT NULL auto_increment,
159 realmname varchar(64),
162 options varchar(128) DEFAULT '',