Book Image

Getting Started with MariaDB

By : Daniel Bartholomew
Book Image

Getting Started with MariaDB

By: Daniel Bartholomew

Overview of this book

MariaDB is a database that has become very popular in the few short years that it has been around. It does not require a big server or expensive support contract. It is also powerful enough to be the database of choice for some of the biggest and most popular websites in the world, taking full advantage of the latest computing hardware available. From installing and configuring through basic usage and maintenance, each chapter in this revised and expanded guide leads on sequentially and logically from the one before it, introducing topics in their natural order so you learn what you need, when you need it. The book is based on the latest release of MariaDB and covers all the latest features and functions. By the end of this beginner-friendly book, not only will you have a running installation of MariaDB, but you will have practical, hands-on experience in the basics of how to install, configure, administer, use, and maintain it.
Table of Contents (16 chapters)
Getting Started with MariaDB Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
MariaDB Next Steps
Index

Installing MariaDB on Mac OS X


One of the easiest ways to install MariaDB on Mac OS X is to use Homebrew, which is an open source package manager for that platform. Before you can install it, however, you need to prepare your system. The first thing you need to do is install Xcode—Apple's integrated development environment. It's available for free from the Mac App Store.

Once Xcode is installed, you can install brew. Full instructions are available on the Homebrew Project website at http://brew.sh but the basic procedure is to open a terminal and run the following command:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The preceding command downloads the installer and runs it. Once the initial installation is complete, we run the following command to make sure everything is set up properly:

brew doctor

The output of the preceding command will tell us about any potential issues, along with suggestions to fix them. Once brew is working properly, we can install MariaDB with the following commands:

brew update
brew install mariadb

Tip

There is no option to choose a specific MariaDB series; whatever is the current version in brew is the one that will be installed. Also, brew will not prompt you to set a database user password during installation, this is dangerous, so be sure to set one immediately afterwards, following the instructions in Chapter 3, Securing MariaDB.

MariaDB will not automatically be started after installation. To do so, we run the following commands:

ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

To stop MariaDB, we use the unload command, as follows:

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

To learn about installing MariaDB on Linux, read on. Otherwise, skip to the After the installation section at the end of this chapter.