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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MariaDB Cookbook

You're reading from   MariaDB Cookbook Learn how to use the database that's growing in popularity as a drop-in replacement for MySQL. The MariaDB Cookbook is overflowing with handy recipes and code examples to help you become an expert simply and speedily.

Arrow left icon
Product type Paperback
Published in Mar 2014
Publisher
ISBN-13 9781783284399
Length 282 pages
Edition Edition
Languages
Tools
Concepts
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 (20) Chapters Close

MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with MariaDB FREE CHAPTER 2. Diving Deep into MariaDB 3. Optimizing and Tuning MariaDB 4. The TokuDB Storage Engine 5. The CONNECT Storage Engine 6. Replication in MariaDB 7. Replication with MariaDB Galera Cluster 8. Performance and Usage Statistics 9. Searching Data Using Sphinx 10. Exploring Dynamic and Virtual Columns in MariaDB 11. NoSQL with HandlerSocket 12. NoSQL with the Cassandra Storage Engine 13. MariaDB Security Index

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

You have been reading a chapter from
MariaDB Cookbook
Published in: Mar 2014
Publisher:
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.
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