SystemMen - This article will walk you through how to install MariaDB 10.2 in CentOS 7. MariaDB is an improved version of MySQL. By default, when you install MariaDB in CentOS 7, it will install version 5.5.
Here is the minimum configuration required that I use.
- OS: CentOS 7.4.1708 (Core) 64 bit.
- RAM: over 1GB memory.
- HDD: over 5GB free space. Maybe you need more for store databases.
- User: root.
- IP: set static ip, ex: 192.168.56.4.
Added MariaDB repository
First, we will add a MariaDB repository to CentOS 7, which is based on information from the MariaDB home page.
You type the following command. Note that there are no spaces before each line in the command below.
cat > /etc/yum.repos.d/MariaDB.repo <<"EOF" [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 EOF
After adding the repository, you may want to update the packages.
yum update -y
Install MariaDB in CentOS 7
Now, type the following command to install MariaDB in CentOS 7.
yum install MariaDB-server MariaDB-client -y
Installation may take 5 to 10 minutes depending on your internet connection condition.
systemctl enable mariadb systemctl start mariadb
Interestingly, if you are familiar with CentOS 6. You can still use the command below to check the service and both of these commands work equally.
service mysql status service mariadb status
Finally, you need to set up the initial security for the MariaDB server using the following command. You will answer some basic questions, set the root password (if not set).
Set rules in Firewalld
If you are installing MariaDB all-in-one then you can skip this step, because MariaDB will use as in LAN. If you want to allow other machines to connect to the MariaDB server on this machine then you need to set up the rule in the Firewalld.
You run the following commands in turn and after each command if the success line appears then you type correctly.
firewall-cmd --permanent --add-service=mysql firewall-cmd --permanent --add-port=3306/tcp firewall-cmd --reload
Check out the MariaDB server
Now you can type the following command to log into the MariaDB server to see how the results. Type root’s password.
mysql -u root -p
If you can login to the window as shown in the image above, congratulations on installing MariaDB 10.2 in CentOS 7 successfully. Now you can start creating new databases and use them.If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.
If you appreciate what we share in this blog, you can support us by:
- Stay connected to: Facebook | Twitter | Google Plus | YouTube
- Subscribe email to recieve new posts from us: Sign up now.
- Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
- Become a Supporter - Make a contribution via PayPal.
- Support us by purchasing Ribbon Lite Child theme being using on this website.
We are thankful for your support.