blob: 19f4a5bd9254c5e3e7c61057034f594a8799849e [file] [log] [blame]
Pamela Dragoshd1728dc2017-02-14 19:57:17 -05001#sed -i '/^bind-address/s/127\.0\.0\.1/0.0.0.0/' /etc/mysql/my.cnf
2cat >/etc/mysql/conf.d/policy.cnf <<-'EOF'
3 [mysqld]
4 lower_case_table_names = 1
5 bind-address = 0.0.0.0
6EOF
7
8echo "Starting mysqld"
9service mysql start
10
11echo "Run mysql_secure_installation"
12/usr/bin/mysql_secure_installation <<-EOF
13
14 y
15 secret
16 secret
17 y
18 y
19 y
20 y
21EOF
22
23echo "Creating db schemas and user"
24mysql -uroot -psecret <<-EOF
25 create database xacml;
26 create database log;
27 create database support;
28 create table support.db_version(the_key varchar(20) not null, version varchar(20), primary key(the_key));
29 insert into support.db_version values('VERSION', '00');
30 insert into support.db_version values('DROOLS_VERSION', '00');
31 create user 'policy_user'@'localhost' identified by 'policy_user';
32 grant all privileges on *.* to 'policy_user'@'localhost' with grant option;
33 flush privileges;
34 select * from support.db_version;
35EOF
36
37echo "Stopping mysqld"
38service mysql stop