Search icon CANCEL
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
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 Mac OS X


Installing MariaDB on Mac OS X is similar to installing it on Linux (refer to the previous recipe), with one important difference: the MariaDB developers do not provide the installer; instead, it is provided by the brew project.

Getting ready

In order to install MariaDB on Mac OS X, we must first install Xcode from the Mac App Store. Once that is installed, we need to install and configure brew. The complete set of instructions for how to do this are on the brew website, http://brew.sh/, but the basic command is:

ruby -e \
  "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

After installing brew, we will run the following doctor command to make sure that everything is set up properly:

brew doctor

When the doctor command finds an issue, and it might find several, it will print out a suggested fix for each one. To ensure that brew is happy, we need to follow the instructions until the doctor command gives us the following message:

Your system is ready to brew.

How to do it…

Let's get started by following the ensuing steps:

  1. Run the following commands in our terminal:

    brew update
    brew install mariadb
    
  2. If there are any dependencies, they will be installed first, and then brew will download the latest stable MariaDB source code tarball, compile it, and then install it.

  3. Once the installation has finished, link the MariaDB startup plist to the LaunchAgents directory as follows, so that MariaDB will start automatically:

    ln -sfv /usr/local/opt/mariadb/*.plist \
        ~/Library/LaunchAgents
    
  4. To start MariaDB, use the following launchctl command to load the plist file:

    launchctl load \
        ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
    
  5. To stop MariaDB, unload the plist file:

    launchctl unload \
        ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
    

How it works...

The brew installer works like a Linux package manager. Many open source software packages can be installed with it, including MariaDB.

The brew installer does not set a password for the root user, so the first thing that we should do after getting MariaDB running on Mac OS X is to run the mysql_secure_installation script. For more information, refer to the Securing MariaDB with mysql_secure_installation recipe in Chapter 13, MariaDB Security.

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 €18.99/month. Cancel anytime