Installing MariaDB on Windows and Mac OS X

Exclusive offer: get 50% off this eBook here
Getting Started with MariaDB

Getting Started with MariaDB — Save 50%

Learn how to use MariaDB to store your data easily and hassle-free with this book and ebook

$20.99    $10.50
by Daniel Bartholomew | October 2013 | Open Source

In this article by Daniel Bartholomew, author of the book Getting Started with MariaDB, we will learn how to install MariaDB on Windows and Mac OS X.

(For more resources related to this topic, see here.)

Installing MariaDB on Windows

There are two types of MariaDB downloads for Windows: ZIP files and MSI packages. As mentioned previously, the ZIP files are similar to the Linux binary .tar.gz files and they are only recommended for experts who know they want it. If we are starting out with MariaDB on Windows, it is recommended to use the MSI packages. Here are the steps to do just that:

  1. Download the MSI package from https://downloads.mariadb.org/. First click on the series we want (stable, most likely), then locate the Windows 64-bit or Windows 32-bit MSI package. For most computers, the 64-bit MSI package is probably the one that we want, especially if we have more than 4 Gigabytes of RAM. If you're unsure, the 32-bit package will work on both 32-bit and 64-bit computers.
  2. Once the download has finished, launch the MSI installer by double-clicking on it. Depending on our settings we may be prompted to launch it automatically. The installer will walk us through installing MariaDB.

  3. If we are installing MariaDB for the first time, we must be sure to set the root user password when prompted.

  4. Unless we need to, don't enable access from remote machines for the root user or create an anonymous account.

  5. The Install as service box is checked by default, and it's recommended to keep it that way so that MariaDB starts up when the computer is booted. The Service Name textbox has the default value MySQL for compatibility reasons, but we can rename it if we like.
  6. Check the Enable networking option, if you need to access the databases from a different computer. If we don't it's best to uncheck this box. As with the service name, there is a default TCP port number (3306) which you can change if you want to, but it is usually best to stick with the default unless there is a specific reason not to.
  7. The Optimize for transactions checkbox is checked by default. This setting can be left as is.

  8. There are other settings that we can make through the installer. All of them can be changed later by editing the my.ini file, so we don't have to worry about setting them right away.
  9. If our version of Windows has User Account Control enabled, there will be a pop-up during the installation asking if we want to allow the installer to install MariaDB. For obvious reasons, click on Yes.
  10. After the installation completes, there will be a MariaDB folder added to the start menu. Under this will be various links, including one to the MySQL Client.

    If we already have an older version of MariaDB or MySQL running on our machine, we will be prompted to upgrade the data files for the version we are installing, it is highly recommended that we do so.

  11. Eventually we will be presented with a dialog box with an installation complete message and a Finish button. If you got this far, congratulations! MariaDB is now installed and running on your Windows-based computer. Click on Finish to quit the installer.

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 in the Mac App Store.

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

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

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

brew doctor

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

brew update brew install mariadb

Unlike on Linux and Windows, brew does not automatically set up or offer to set up MariaDB to start automatically when your system boots or start MariaDB after installation. To do so, we perform the following command:

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

Summary

In this article, we learned how to install MariaDB on Windows and Mac OS X.

Resources for Article:


Further resources on this subject:


Getting Started with MariaDB Learn how to use MariaDB to store your data easily and hassle-free with this book and ebook
Published: October 2013
eBook Price: $20.99
Book Price: $34.99
See more
Select your format and quantity:

About the Author :


Daniel Bartholomew

Daniel Bartholomew has been using Linux since 1997 and databases since 1998. He is a frequent contributor to various magazines, including The Linux Journal, Linux Pro, Ubuntu, User, and Tux.

He has been involved with the MariaDB project since shortly after it began in early 2009. He currently works for SkySQL and splits his time between MariaDB documentation and maintaining the bits and pieces (including build, e-mail, web, and other servers), which keeps the MariaDB project running smoothly. In addition to his day-to-day responsibilities, he also serves as the MariaDB release coordinator and has been deeply involved with almost every MariaDB release.

He lives in Raleigh, North Carolina, U.S.A. with his lovely wife and awesome children.

Books From Packt


 MariaDB Cookbook
MariaDB Cookbook

 Instant MongoDB [Instant]
Instant MongoDB [Instant]

CouchDB and PHP Web Development Beginner's Guide
CouchDB and PHP Web Development Beginner's Guide

 PHP and MongoDB Web Development Beginner’s Guide
PHP and MongoDB Web Development Beginner’s Guide

Getting Started with OrientDB
Getting Started with OrientDB

 Instant InnoDB [Instant]
Instant InnoDB [Instant]

 RavenDB High Performance
RavenDB High Performance

Ruby and MongoDB Web Development Beginner's Guide
Ruby and MongoDB Web Development Beginner's Guide


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software