Reader small image

You're reading from  MariaDB Cookbook

Product typeBook
Published inMar 2014
Reading LevelBeginner
Publisher
ISBN-139781783284399
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Daniel Bartholomew
Daniel Bartholomew
author image
Daniel Bartholomew

Daniel Bartholomew has been using Linux since 1997 and databases since 1998. In addition to this book, he has also written MariaDB Cookbook, Packt Publishing, and dozens of articles for various magazines, including The Linux Journal, Linux Pro, Ubuntu User, and Tux. He became involved with the MariaDB project shortly after it began in early 2009 and continues to be involved to this day. He currently works for MariaDB, Inc. and splits his time between managing MariaDB releases, documentation, and maintaining various bits and pieces that keep the MariaDB project running smoothly.
Read more about Daniel Bartholomew

Right arrow

Installing MariaDB on Linux


Most of the installs of MariaDB are on various flavors of Linux. This recipe will get most Linux users up and running MariaDB quickly and easily.

Getting ready

First, determine which version of Linux we are running. In most cases, we will have installed Linux ourselves, so we will know this information. But on the off chance we do not know the information, the following command will give us the information we need:

cat /etc/lsb-release

On my desktop, the preceding command shows the following output:

daniel@gandalf:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu 
DISTRIB_RELEASE=10.04 
DISTRIB_CODENAME=lucid 
DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS" 

From this, I see that I am running Ubuntu 10.04 "lucid". This is all the information I need.

How to do it...

Let's get started by following the ensuing steps:

  1. Visit http://mariadb.org/downloads/mariadb/repositories and select our distribution, release, version, and (for some distributions) the mirror that we would like to use, as shown in the following screenshot:

  2. Once all of the choices have been made, instructions will appear at the bottom of the page.

  3. On Fedora, CentOS, and Red Hat, the basic instructions are to copy the provided text into the MariaDB.repo file located at /etc/yum.repos.d/ and then to issue the following command in order to install MariaDB:

    sudo yum install MariaDB-server MariaDB-client
    
  4. During the initial installation with yum, we will be asked to accept the key used to sign MariaDB packages. This key has a fingerprint as follows:

    1993 69e5 404b d5fc 7d2f e43b cbcb 082a 1bb9 43db
    
  5. Assuming that the fingerprint shown by yum matches the key fingerprint shown in step 4, go ahead and answer yes to the question.

  6. On Debian and Ubuntu, in addition to choosing the Linux distribution, release, and MariaDB version, we need to choose the mirror that we want to use. After selecting the items in all four boxes, customized instructions for installing MariaDB will appear at the bottom of the page. As an example, the commands to install MariaDB 10.0 on Ubuntu 12.04 LTS "Precise" are as follows:

    sudo apt-get install python-software-properties
    sudo apt-key adv --recv-keys --keyserver \
      keyserver.ubuntu.com 0xcbcb082a1bb943db
    sudo add-apt-repository \
      'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main'
    sudo apt-get update
    sudo apt-get install mariadb-server
    
  7. After the YUM or APT-based installation has finished, we can start and stop MariaDB with the following commands:

    sudo /etc/init.d/mysql start
    sudo /etc/init.d/mysql stop
    

How it works...

The repository configurator supports the following Linux distributions:

  • Red Hat

  • Ubuntu

  • Debian

  • Mint

  • Mageia

  • Fedora

  • CentOS

  • openSUSE

New Linux distributions are added from time to time, so it's possible that when we visit the website, another Linux distribution or two would have been added to the list.

The common feature of all of these distributions is that they use a package manager. Fedora, Red Hat, and CentOS use the Yellowdog Updater Modified (YUM) package manager. Debian, Ubuntu, and Mint use the Advanced Package Tool (APT) package manager. The MariaDB developers provide repositories for these distributions.

Other distributions such as Mageia and openSUSE are different. They use their own custom package managers. MariaDB packages for these Linux distributions are provided by the developers of those distributions. The repository configuration tool provides instructions for the commands that we need to run in order to install MariaDB.

See also

Previous PageNext Page
You have been reading a chapter from
MariaDB Cookbook
Published in: Mar 2014Publisher: ISBN-13: 9781783284399
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.
undefined
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 $15.99/month. Cancel anytime

Author (1)

author image
Daniel Bartholomew

Daniel Bartholomew has been using Linux since 1997 and databases since 1998. In addition to this book, he has also written MariaDB Cookbook, Packt Publishing, and dozens of articles for various magazines, including The Linux Journal, Linux Pro, Ubuntu User, and Tux. He became involved with the MariaDB project shortly after it began in early 2009 and continues to be involved to this day. He currently works for MariaDB, Inc. and splits his time between managing MariaDB releases, documentation, and maintaining various bits and pieces that keep the MariaDB project running smoothly.
Read more about Daniel Bartholomew