Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with MariaDB

You're reading from   Getting Started with MariaDB Explore the powerful features of MariaDB with practical examples

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785284120
Length 140 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniel Bartholomew Daniel Bartholomew
Author Profile Icon Daniel Bartholomew
Daniel Bartholomew
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Installing MariaDB 2. Configuring MariaDB FREE CHAPTER 3. Securing MariaDB 4. Administering MariaDB 5. Using MariaDB – Databases and Tables 6. Using MariaDB – Inserting, Updating, and Deleting 7. Using MariaDB – Retrieving Data 8. Maintaining MariaDB A. MariaDB Next Steps
Index

Installing MariaDB on Fedora, Red Hat, and CentOS

The procedure to install MariaDB on Fedora, Red Hat, and CentOS makes use of the Yellowdog Updater, Modified (YUM) package manager. There are two steps: first, create a repo file for MariaDB and second, install MariaDB.

To generate the required text for the repo file, we will visit the MariaDB repository configuration tool from:

https://downloads.mariadb.org/mariadb/repositories/

Tip

This tool is used for APT-based Linux distributions, such as Debian, Ubuntu, and Mint; Yum-based Linux distributions, such as Fedora, CentOS, and Red Hat; and other distributions that have support for MariaDB built-in, such as Mageia, Arch Linux, Suse, openSUSE, and others.

To generate the text, we simply click on the distribution we are using, the distribution release we are using, and the version of MariaDB we want to install. After doing so, the contents of the appropriate repo file will be displayed.

For example, the text generated for MariaDB 10.1 on the 64-bit version of CentOS 7 is as follows:

# MariaDB 10.1 CentOS repository list
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

The gpgkey line tells YUM where the GPG signing key is located. The gpgcheck=1 line directs YUM to always use the signing key to verify the MariaDB packages.

The first time we install MariaDB, our system will not have the key, so YUM will have to download and install it. Since YUM has never used the key before, it will ask for confirmation whether it is OK to import the key. See the MariaDB package security section for more information on the MariaDB GPG signing key.

We copy and paste the generated text into a file using our favorite text editor. Naming the file descriptively, such as MariaDB.repo, is recommended. Once the file is created, we then move it to the /etc/yum.repos.d/ folder using a command similar to the following one:

sudo mv -vi MariaDB.repo /etc/yum.repos.d/

Once the file is in place, we are ready to install MariaDB. This is as simple as the following:

sudo yum install MariaDB-server MariaDB-client

The capitalization of the package names is important because if we type mariadb-server instead of MariaDB-server, we will either get a package cannot be found error or, if we are using a distribution that includes MariaDB, we will get the distribution version of MariaDB instead of the version from the MariaDB project.

YUM will gather in all of the dependencies for MariaDB and present us with a list of everything that needs to be installed to install MariaDB. The following screenshot shows this:

Installing MariaDB on Fedora, Red Hat, and CentOS

After answering y, the installation will get going and we will be prompted to accept the GPG signing key. We will verify the fingerprint with y. YUM will then continue downloading and installing MariaDB and will end with a Complete! message.

As a final step of the installation, we start MariaDB with the following command:

sudo /etc/init.d/mysql start

If everything has gone well, we will see output similar to the following:

[dbart@centos70-x86-64 ~]$ sudo /etc/init.d/mysql start

Starting MySQL.. SUCCESS! 

MariaDB is now installed and running.

Jump ahead to the MariaDB package security section if you're interested in the MariaDB GPG signing key, or skip to the After the installation section if you want to start using MariaDB right away.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image