Pamela Dragosh | d1728dc | 2017-02-14 19:57:17 -0500 | [diff] [blame] | 1 | #sed -i '/^bind-address/s/127\.0\.0\.1/0.0.0.0/' /etc/mysql/my.cnf |
| 2 | cat >/etc/mysql/conf.d/policy.cnf <<-'EOF' |
| 3 | [mysqld] |
| 4 | lower_case_table_names = 1 |
| 5 | bind-address = 0.0.0.0 |
| 6 | EOF |
| 7 | |
| 8 | echo "Starting mysqld" |
| 9 | service mysql start |
| 10 | |
| 11 | echo "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 |
| 21 | EOF |
| 22 | |
| 23 | echo "Creating db schemas and user" |
| 24 | mysql -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; |
| 35 | EOF |
| 36 | |
| 37 | echo "Stopping mysqld" |
| 38 | service mysql stop |