{"id":3218,"date":"2019-06-05T00:03:42","date_gmt":"2019-06-04T21:03:42","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3218"},"modified":"2019-06-05T00:03:43","modified_gmt":"2019-06-04T21:03:43","slug":"install-mariadb-10-3-on-centos-7","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mariadb-10-3-on-centos-7\/","title":{"rendered":"Install MariaDB 10.3 on CentOS 7"},"content":{"rendered":"\n

This guide will quickly take you through how to install MariaDB 10.3<\/a> on CentOS 7. The current stable release of MariaDB is v10.3.15. Se how to install MariaDB 10.3 on Fedora 30 by following the link below;<\/p>\n\n\n\n

Install MariaDB 10.3 on Fedora 30<\/a><\/p>\n\n\n\n

Install MariaDB 10.3 on CentOS 7<\/h2>\n\n\n\n

Update and upgrade your system packages.<\/p>\n\n\n\n

yum update\nyum upgrade<\/code><\/pre>\n\n\n\n

Adding the MariaDB YUM repository<\/h3>\n\n\n\n

The latest stable version of MariaDB is not available on the default CentOS 7 repositories. Hence you need to add the YUM repository so as to install the latest version of MariaDB<\/p>\n\n\n\n

cat > \/etc\/yum.repos.d\/mariadb.10.3.repo << EOF\n[mariadb]\nname = MariaDB\nbaseurl = http:\/\/yum.mariadb.org\/10.3\/centos7-amd64\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1\nEOF<\/code><\/pre>\n\n\n\n

Next, run the system update again to resynchronize packages to their latest versions.<\/p>\n\n\n\n

yum update -y<\/code><\/pre>\n\n\n\n

Install MariaDB 10.3 on CentOS 7<\/h3>\n\n\n\n

Once you have the MariaDB repos in place, proceed to do the installation of both MariaDB server and client by executing the commands below;<\/p>\n\n\n\n

yum install mariadb mariadb-server<\/code><\/pre>\n\n\n\n
...\n===========================================================================\n Package                 Arch   Version                      Repository\n                                                                      Size\n===========================================================================\nInstalling:\n MariaDB-client          x86_64 10.3.15-1.el7.centos         mariadb  11 M\n MariaDB-server          x86_64 10.3.15-1.el7.centos         mariadb  24 M\n...<\/code><\/pre>\n\n\n\n

Running MariaDB on CentOS 7<\/h3>\n\n\n\n

Once the installation is done, you can start and enable MariaDB to run on system boot by executing the commands below;<\/p>\n\n\n\n

systemctl start mariadb\nsystemctl enable mariadb<\/code><\/pre>\n\n\n\n

Set MariaDB Root Password<\/h3>\n\n\n\n

To set the MariaDB root password, run the command below. Replace new-password<\/strong> with your password. <\/p>\n\n\n\n

mysqladmin -u root password 'new-password'<\/code><\/pre>\n\n\n\n

The password can also be set using the MariaDB security script.<\/p>\n\n\n\n

Initial MariaDB Security<\/h3>\n\n\n\n

MariaDB ships with a simple MariaDB security script, mysql_secure_installation<\/strong>, that basically enables you to remove test databases and anonymous user created by default. This is strongly recommended for production servers. This script can be simply run as;<\/p>\n\n\n\n

mysql_secure_installation<\/code><\/pre>\n\n\n\n

The first prompt would be to set the root password. however, if you have set it above, just enter the password and proceed.<\/p>\n\n\n\n

...\nIn order to log into MariaDB to secure it, we'll need the current\npassword for the root user.  If you've just installed MariaDB, and\nyou haven't set the root password yet, the password will be blank,\nso you should just press enter here.\n\nEnter current password for root (enter for none): \nOK, successfully used password, moving on...\n\nSetting the root password ensures that nobody can log into the MariaDB\nroot user without the proper authorisation.\n\nYou already have a root password set, so you can safely answer 'n'.\n\nChange the root password? [Y\/n] n<\/code><\/pre>\n\n\n\n

Next, remove the database anonymous user.<\/p>\n\n\n\n

By default, a MariaDB installation has an anonymous user, allowing anyone\nto log into MariaDB without having to have a user account created for\nthem.  This is intended only for testing, and to make the installation\ngo a bit smoother.  You should remove them before moving into a\nproduction environment.\n\nRemove anonymous users? [Y\/n] y\n ... Success!<\/code><\/pre>\n\n\n\n

Disable remote root login<\/p>\n\n\n\n

Normally, root should only be allowed to connect from 'localhost'.  This\nensures that someone cannot guess at the root password from the network.\n\nDisallow root login remotely? [Y\/n] \n ... Success!<\/code><\/pre>\n\n\n\n

Remove test databases<\/p>\n\n\n\n

By default, MariaDB comes with a database named 'test' that anyone can\naccess.  This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n\nRemove test database and access to it? [Y\/n] y\n - Dropping test database...\n ... Success!\n - Removing privileges on test database...\n ... Success!<\/code><\/pre>\n\n\n\n

Reload the privileges tables to effect the changes.<\/p>\n\n\n\n

Reloading the privilege tables will ensure that all changes made so far\nwill take effect immediately.\n\nReload privilege tables now? [Y\/n] y    \n ... Success!<\/code><\/pre>\n\n\n\n

That is all about the installation MariaDB 10.3.<\/p>\n\n\n\n

To verify that you MariaDB is working fine, login and run some test queries. For example to check the version;<\/p>\n\n\n\n

mysql -u root -p<\/code><\/pre>\n\n\n\n
MariaDB [(none)]> select version();\n+-----------------+\n| version()       |\n+-----------------+\n| 10.3.15-MariaDB |\n+-----------------+\n1 row in set (0.003 sec)\n\nMariaDB [(none)]><\/code><\/pre>\n\n\n\n

Well, all is well now. You have successfully installed MariaDB on CentOS 7.<\/p>\n\n\n\n

You can check our other guides by following the links below;<\/p>\n\n\n\n

How to Install LEMP (Nginx,MariaDB,PHP7.2) Stack on Fedora 28 \/ Fedora 29<\/a><\/p>\n\n\n\n

How To Setup LEMP Stack (Nginx, MariaDB, PHP 7.2) on Ubuntu 18.04<\/a><\/p>\n\n\n\n

How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n

A Simple Way to Reset MySQL\/MariaDB root Password<\/a><\/p>\n\n\n\n

Install phpMyAdmin with Nginx on Fedora 30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

This guide will quickly take you through how to install MariaDB 10.3 on CentOS 7. The current stable release of MariaDB is v10.3.15. Se how<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[299,121,928,929],"tags":[88,136,970],"class_list":["post-3218","post","type-post","status-publish","format-standard","hentry","category-database","category-howtos","category-mariadb","category-mysql","tag-centos-7","tag-mariadb","tag-mariadb-10-3","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3218"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3218"}],"version-history":[{"count":2,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3218\/revisions"}],"predecessor-version":[{"id":3220,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3218\/revisions\/3220"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}