Procházet zdrojové kódy

Updated trias_dbserver script for automation

pull/14/head
Steffan JJ před 1 rokem
rodič
revize
75ba03d6a9
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12
    0
      trias/Server/trias_dbserver_script.sh

+ 12
- 0
trias/Server/trias_dbserver_script.sh Zobrazit soubor

@@ -3,6 +3,8 @@ sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service

sleep 2

#STEPS FOR MYSQL_SECURE_INSTALLATION
#STEP-1 sudo mysql
#STEP-2 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SET_PASSWORD';
@@ -20,4 +22,14 @@ sudo systemctl start mysql.service
#STEP-14 GRANT ALL PRIVILEGES ON *.* TO '_username_'@'_desiredIP_' WITH GRANT OPTION;
#STEP-15 FLUSH PRIVILEGES;

echo "Please enter password for mysql: "
read password
sudo mysql -u root -p${password} -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${password}'"
sudo sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf
sudo systemctl restart mysql
echo "Please enter the IP address of app server: "
read IP
sudo mysql -u root -p${password} CREATE USER 'root'@'${IP}' IDENTIFIED WITH mysql_native_password BY '${password}';
sudo mysql -u root -p${password} GRANT ALL PRIVILEGES ON *.* TO 'root'@'${IP}' WITH GRANT OPTION;
FLUSH PRIVILEGES;


Načítá se…
Zrušit
Uložit