Getting Started with MariaDB — Save 50%
Learn how to use MariaDB to store your data easily and hassle-free with this book and ebook
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:
- 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.
- 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.
- If we are installing MariaDB for the first time, we must be sure to set the root user password when prompted.
- Unless we need to, don't enable access from remote machines for the root user or create an anonymous account.
- 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.
- 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.
- The Optimize for transactions checkbox is checked by default. This setting can be left as is.
- 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.
- 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.
- 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.
- 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:
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
In this article, we learned how to install MariaDB on Windows and Mac OS X.
Resources for Article:
- Ruby with MongoDB for Web Development [Article]
- So, what is MongoDB? [Article]
- Schemas and Models [Article]
eBook Price: $20.99
Book Price: $34.99
About the Author :
Daniel Bartholomew has been using Linux since 1997 and databases since 1998. He has written dozens of articles for various magazines, including The Linux Journal, Linux Pro, Ubuntu, User and Tux.
Daniel has been involved with the MariaDB project 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) that keep the MariaDB project running smoothly. In addition to his day-to-day responsibilities, Daniel also serves as the MariaDB release coordinator and has been deeply involved with almost every MariaDB release.
He lives in Raleigh, North Carolina, USA with his lovely wife and four children.