{"id":9318,"date":"2019-02-08T19:36:19","date_gmt":"2019-02-08T19:36:19","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=9318"},"modified":"2019-02-10T05:30:07","modified_gmt":"2019-02-10T05:30:07","slug":"how-to-install-mariadb-on-centoslinuxcloudvps-blog","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/08\/how-to-install-mariadb-on-centoslinuxcloudvps-blog\/","title":{"rendered":"How to Install MariaDB on CentOS &#8211; LinuxCloudVPS Blog"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/install-mariadb-centos.jpg\" alt=\"\" width=\"750\" height=\"360\" \/><\/p>\n<p>On a fresh Linux installation, you may have MySQL already installed on your system. While that might be enough for most users, sometimes the newest version of the query language is necessary for some software to work. This tutorial will show you how to install MariaDB as a drop-in replacement for MySQL for all versions of CentOS, and all versions of MariaDB.<\/p>\n<h2>What is MariaDB?<\/h2>\n<p>When Oracle took over the development of MySQL in 2008, it switched to a slower release cycle, and the development became a lot more opaque. One of the lead developers of MySQL decided to fork the project, and MariaDB is the result. The idea was to continue the development of the database in a community-driven manner and to provide a \u201cdrop-in\u201d replacement for MySQL.<\/p>\n<h2>What is a \u201cDrop-in\u201d Replacement?<\/h2>\n<p>It simply means that you don\u2019t have to change any other configuration on systems that rely on MySQL. Once you install and activate MariaDB, all other programs that used to work with MySQL will now work seamlessly on MariaDB.<\/p>\n<p>In other words, if you\u2019re running WordPress, you don\u2019t need to change any scripts or your wp-config.php file when you migrate to MariaDB.<\/p>\n<p>Here\u2019s how to install MariaDB on a <a href=\"https:\/\/www.linuxcloudvps.com\/centos-cloud-vps.html\">CentOS VPS<\/a>.<\/p>\n<h2>Step 1: Get the MariaDB and CentOS Version<\/h2>\n<p>The URL from which we get the MariaDB packages depends on the OS version, as well as the version of MariaDB we want to install. To get your OS version, type the following command:<\/p>\n<p>cat \/etc\/redhat-release<\/p>\n<p>This will tell you which version of CentOS you\u2019re running. In this example, we\u2019re going to use CentOS version 6.10. As of this writing, the stable version of MariaDB is sitting on 10.3, so that\u2019s what we\u2019re going to install right now.<\/p>\n<h2>Step 2: Get the Script for the MariaDB Repository<\/h2>\n<p>The official website makes it easy to configure the repository script. <a href=\"https:\/\/downloads.mariadb.org\/mariadb\/repositories\/\">Visit the interactive tool<\/a> and choose your OS, as well as the OS version and the MariaDB package that you want to install, based on what you decided in Step 1. Here\u2019s a screenshot of our configuration:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/Generate-Repository.jpg\" alt=\"Generate the Repository\" \/><\/p>\n<p>Once you make these selections, it\u2019ll display a snippet of text on the bottom of the page. Like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/Entry-for-Yum-Repo.jpg\" alt=\"Entry for Yum Repository\" \/><\/p>\n<p>The important part is the \u201cbaseurl\u201d parameter as shown above. This is what varies between various installations.<\/p>\n<h2>Step 3: Create the Repo File in CentOS<\/h2>\n<p>The next step is to create a file in the following directory:<\/p>\n<p>\/etc\/yum.repos.d\/<\/p>\n<p>We\u2019re going to name it \u201cMariaDB.repo\u201d for easy reference later on. Use a text editor like nano or vi to paste the code you got in Step 2 into the file like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/Create-Yum-Repo-File.jpg\" alt=\"Create the Yum Repository File\" \/><\/p>\n<p>Save your changes, and you\u2019re done with adding the repository file. Make sure to have yum recognize the changes by running this command:<\/p>\n<p>sudo yum update<\/p>\n<h2>Step 4: Installing MariaDB<\/h2>\n<p>Now that the repo is configured, we can install MariaDB by typing in the following:<\/p>\n<p>sudo yum install MariaDB-server MariaDB-client<\/p>\n<p>Note that if you had a previous MariaDB repo, or accidentally used the wrong one, you would have gotten a message saying:<\/p>\n<p>&#8220;No package MariaDB-server available&#8221;<\/p>\n<p>Unfortunately, the configurations are saved, so before you run the \u201cyum\u201d command with a new repo, you must remember to flush it with the command:<\/p>\n<p>yum clean metadata<\/p>\n<p>But if everything goes well, you should now be able to install the MariaDB packages like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/Replace-MySQL-1.jpg\" alt=\"Replace MySQL\" \/><\/p>\n<p>Note how it says \u201creplacing mysql\u201d. This means that the new database system will response to the \u201cmysql\u201d command from now on.<\/p>\n<p>If this is the first time you\u2019re installing MariaDB, you\u2019ll also be asked to confirm the import of the GPG key as shown here:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/Import-GPG-Key.jpg\" alt=\"Import GPG Key\" \/><\/p>\n<p>After the installation is complete, you will have MariaDB on your system!<\/p>\n<h2>Step 5: Verifying the Installation<\/h2>\n<p>MariaDB is such a perfect replacement for mysql, that it can be difficult to tell whether the current software running is MySQL or MariaDB! However, if you type the following command:<\/p>\n<p>mysql -V<\/p>\n<p>It will give you the version information, as well as the database system that\u2019s driving it:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2019\/02\/Check-MariaDB-Version.jpg\" alt=\"Check MariaDB Version\" \/><\/p>\n<p>If you followed the tutorial step by step, then congratulations, you\u2019ve replaced MySQL with MariaDB!<\/p>\n<p>Of course, you don\u2019t need to install MariaDB yourself if you have a <a href=\"https:\/\/www.linuxcloudvps.com\/centos-cloud-vps.html\">CentOS VPS<\/a> hosted with us, in which case our expert sysadmins will install MariaDB for you. They are available 24\u00d77 and can help you with any questions or issues that you may have.<\/p>\n<p>PS. If you enjoyed reading this blog post on how to install MariaDB on CentOS, feel free to share it on social networks using the share shortcuts.<\/p>\n<p><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mariadb-on-centos\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On a fresh Linux installation, you may have MySQL already installed on your system. While that might be enough for most users, sometimes the newest version of the query language is necessary for some software to work. This tutorial will show you how to install MariaDB as a drop-in replacement for MySQL for all versions &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/08\/how-to-install-mariadb-on-centoslinuxcloudvps-blog\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install MariaDB on CentOS &#8211; LinuxCloudVPS Blog&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9318","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=9318"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9318\/revisions"}],"predecessor-version":[{"id":9449,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9318\/revisions\/9449"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=9318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=9318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=9318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}