-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtomcatAuth.sql
More file actions
43 lines (35 loc) · 752 Bytes
/
tomcatAuth.sql
File metadata and controls
43 lines (35 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Ref: https://tomcat.apache.org/tomcat-3.3-doc/JDBCRealm-howto.html
CREATE DATABASE IF NOT EXISTS `dbrealm` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `dbrealm`;
create table users
(
user_name varchar(15) not null primary key,
user_pass varchar(15) not null
);
create table roles
(
role_name varchar(15) not null primary key
);
create table user_roles
(
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key( user_name, role_name )
);
#Populate tables with user data
INSERT INTO `dbrealm`.`roles`
(`role_name`)
VALUES
('admin');
INSERT INTO `dbrealm`.`users`
(`user_name`,
`user_pass`)
VALUES
('tomcat',
'password');
INSERT INTO `dbrealm`.`user_roles`
(`user_name`,
`role_name`)
VALUES
('tomcat',
'admin');