-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.txt
executable file
·34 lines (25 loc) · 1.19 KB
/
database.txt
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
#!/bin/bash
#cat > ~/mysqldb.sh << EOF
sleep 120
sudo yum update -y
sudo setsebool -P httpd_can_network_connect_db 1
sudo yum install -y php php-pear php-mysql
sudo yum install -y mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql -u root -e 'CREATE TABLE mytable (mycol varchar(255));' test
sudo mysql -u root -e 'INSERT INTO mytable (mycol) values ("MyValues") ;' test
sudo mysql -u root -e "grant all on test.* to 'root'@'localhost';"
sudo mysql -u root -e "grant all on test.* to 'root'@'%';"
sudo mysql -u root -e "create user 'phh'@'%' IDENTIFIED BY 'kjh865LJHG98[[76';"
#sudo mysql -u root -e "create user 'phh'@'localhost' IDENTIFIED BY 'kjh865LJHG98[[76';"
#sudo mysql -u root -e "grant all privileges on *.* to 'phh'@'localhost';"
sudo mysql -u root -e "grant all privileges on *.* to 'phh'@'%';"
sudo mysql -u root -e "grant all on test.* to 'phh'@'%';"
sudo mysql -u root -e "flush privileges;"
sudo mysql -u root -e "set password for 'root'@'localhost' = PASSWORD('kjh865LJHG98[[76');"
#echo "MYSQL COMPLETE ********************************"
#ALTER user root IDENTIFIED BY 'kjh865LJHG98[[76';
#EOF
#chmod 777 ~/mysqldb.sh
#sudo ~/mysqldb.sh > ~/mysqldb.log