Browse Source

Updated db_server script for trias

pull/14/head
Steffan JJ 1 year ago
parent
commit
1ee3d71eac
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      trias/Server/trias_dbserver_script.sh

+ 4
- 4
trias/Server/trias_dbserver_script.sh View File



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



Loading…
Cancel
Save