Last active
August 26, 2020 09:14
-
-
Save suhail-sullad/499e352a5388df8bb77d18ea3810f12f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cat > /etc/yum.repos.d/mariadb.repo <<EOL | |
[mariadb] | |
name = MariaDB | |
baseurl = http://yum.mariadb.org/10.3.22/centos7-amd64 | |
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | |
gpgcheck=1 | |
enabled=1 | |
EOL | |
sudo yum update -y | |
sudo yum install -y MariaDB-server MariaDB-client net-tools | |
sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config | |
sudo service sshd restart | |
sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/my.cnf.d/server.cnf | |
# adding grant privileges to mysql root user from everywhere | |
MYSQL=`which mysql` | |
passkey='cfcNEBdUm6QerR6oo2UM' | |
Q1="GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY '$passkey' WITH GRANT OPTION;" | |
Q2="FLUSH PRIVILEGES;" | |
SQL="${Q1}${Q2}" | |
service mysql restart | |
sudo $MYSQL -uroot -e "$SQL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment