Install MySQL on your Mac – Sequel Pro

For beginners

Mac OS X does not’t ship with its own copy of MySQL, nor does Sequel Pro. You will have to install a copy on your local machine or connect to the MySQL server on a machine somewhere on the Internet.

Most web servers and website packages will include a MySQL installation as part of the services they provide, and they usually provide external connection details to allow you to connect to them in an external program like Sequel Pro. (See Web Hosting Providers for a list of hosting options.)

There are several different ways to install MySQL on Mac OS X. We have provided links to the most common installation methods for Mac OS X.

Using the official .pkg installer

This is the fastest method to install MySQL on your Mac, but it’s only available for Intel processors. MySQL.com offers a standard MacOS installation package that installs MySQL Server and several command-line utilities. The download also includes a system preferences pane to start/stop the server. Optionally, you can install a startup item that starts the MySQL server when the computer starts. The download weighs around 70MB.

MySQL 5.0 for Mac OS X — for MacOS 10.4-10.5, Intel only MySQL 5.1 for Mac OS X — for MacOS 10.4-10.6, Intel only, recommended version MySQL 5.5 for Mac OS X — for MacOS 10.4-10.6, Intel only MAMP/XAMPP

on Mac OS X MAMP

and XAMPP are complete web development packages. They are designed to give developers an easy way to serve PHP pages using Apache and MySQL directly on their Mac. The two packages differ in the selection of utilities they include, but both include their own version of Apache, MySQL, and PHP.

These packages are installed by copying the MAMP/XAMPP folder to the Applications folder. There are no hidden files and both packages are trivial to uninstall – just drag the MAMP/XAMPP folder to the trash.

MAMP includes a GUI utility to start and stop servers. The utility also allows basic configuration of servers, including the port on which MySQL runs (default is 8889). There is a commercial utility (called MAMP PRO) available for more advanced options. MAMP includes PHP 4 and 5.2, and MySQL 5.1. The download is approximately 160MB.

Download MAMP/MAMP Pro – for MacOS 10.4-10.6, Universal binary

XAMPP provides only one utility to start/stop servers. Configuration is done using command-line utilities. XAMPP includes PHP 5.3, MySQL 5.1 and several extras such as Perl and an FTP server. XAMPP weighs around 90MB.

Download XAMPP — for MacOS 10.4-10.6, universal binary

If you use one of these packages, see Connecting to MAMP or XAMPP for instructions

.

Install

from source

It is recommended to install a copy of MySQL from source code for advanced users only. There are many advantages to building your own copy of MySQL, including speed improvements and system-specific customizations (e.g. for machines with low RAM). Installing from the source also gives you access to state-of-the-art features and bug fixes before a .pkg installer is available.

You must have the Xcode development tools installed. Compiling takes a lot of time compared to installing binaries, but you’ll only need to download about 20 MB of source code.

Installing from source — MySQL Tutorial for Tiger and Leopard — Hive Logic Tutorial for Snow Leopard — Hive Logic

Using MacPorts

If you want to install from source, but save yourself the trouble of setting up the installation, you can use Macports to build and install MySQL automatically. This method only works if you have MacPorts and XCode Developer Tools installed. The MySQL download is approximately 20 MB plus dependencies.

With MacPorts you can install MySQL Server

by typing the following command in Terminal

: sudo port install mysql5-server

Next, you need to run

: sudo -u _mysql /opt/local/bin/mysql_install_db5 Start MySQL: sudo port load mysql5-server Stop MySQL: sudo port unload mysql5-server

Mac OS X Server comes

with MySQL pre-installed. For instructions on how to enable MySQL, see Setup in Mac OS X Server.

Articles by Slicehost

Install MySQL on Ubuntu HardyInstall MySQL on CentOS Install MySQL on Debian

Lenny Install MySQL on Debian Etch