Skip to content

Instantly share code, notes, and snippets.

@hoangdh
Last active May 27, 2019 03:35
Show Gist options
  • Save hoangdh/da812aa326c5f62f9b771821d4177755 to your computer and use it in GitHub Desktop.
Save hoangdh/da812aa326c5f62f9b771821d4177755 to your computer and use it in GitHub Desktop.
Quick install MariaDB 10.3 on CentOS 7.3
#!/bin/bash
cat > /etc/yum.repos.d/mariadb.repo << EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos73-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
yum install MariaDB-server MariaDB-client -y
systemctl start mariadb
systemctl enable mariadb
### Remove test's db; user and set password root
mysql -uroot -e "DROP DATABASE test;"
mysql -e "DELETE FROM mysql.user WHERE user LIKE '';"
mysql -e "FLUSH PRIVILEGES;"
clear
echo "Please reset password root user mysql's!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment