Browse Source

Merge branch 'master' of http://git.bbh/chess/elxr

master
pb 2 days ago
parent
commit
c29739892b
1 changed files with 25 additions and 0 deletions
  1. 25
    0
      i.mysql.centos.sh

+ 25
- 0
i.mysql.centos.sh View File

@@ -53,3 +53,28 @@ bash elxr/mysql.init.sh
# y
# EOF


echo "Creating or Updating CIHSR User with remote access"

# Prompt for MySQL root password
read -sp "Enter MySQL root password: " MYSQL_PASSWORD
echo

mysql -u root -p"$MYSQL_PASSWORD" <<EOF
CREATE USER IF NOT EXISTS 'cihsr'@'%' IDENTIFIED BY 'Cihsr@123456';

GRANT ALL PRIVILEGES ON *.* TO 'cihsr'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

ALTER USER 'cihsr'@'%' IDENTIFIED BY 'Cihsr@123456';
EOF

if [ $? -eq 0 ]; then
echo "User 'cihsr' has been successfully created or updated."
else
echo "Error: Failed to create or update user 'cihsr'."
fi

sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent
sudo firewall-cmd --reload


Loading…
Cancel
Save