Documentation :: Install MySQL on Mac OS X

Under Development

(Install from Source)
 
(31 intermediate revisions not shown)
Line 1: Line 1:
-
__NOTOC__
+
== Preface: MySQL for the Newbie ==
-
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 and common VPS hosting solutions.
+
Mac OS X doesn'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.
-
* [[#Using a .pkg installer| Get started quickly with a package installer]]
+
Most webservers and website packages will include a MySQL installation as part of the services they provide, and usually provide external connection details to allow you to connect to them in an external program like Sequel Pro.
-
* [[#Install from Source|Compile MySQL from source]]
+
(See [[Web Hosting Providers]] for a list of hosting options).
-
* [[#MAMP on Mac OS X|MAMP on Mac OS X]]
+
-
* [[#MySQL on VPS host|MySQL on VPS host]]
+
-
== Using a .pkg installer ==
+
= Installing MySQL on your own Mac =
 +
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.
-
By far the easiest way to install MySQL on your Mac MySQL offers a GUI Installation package for quickly installing the MySQL server and client and a Mac OS X preference pane (for starting/stopping MySQL Server).
+
== Using the official .pkg installer ==
 +
This is the fastest method for installing MySQL on your Mac, but only available for Intel processors. [http://www.mysql.com MySQL.com] offers a standard MacOS installer package that installs the MySQL Server and several command line utilities. The download also includes a system preference pane for starting/stopping the server. You can optionally install a startup item that starts the MySQL server when your computer starts. The download weighs about '''70MB'''.
-
[http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg MySQL 5.0 for Mac OS X] — MySQL<br />
+
:[http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg MySQL 5.0 for Mac OS X] — for MacOS 10.4-10.5, Intel only
-
[http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg MySQL 5.1 for Mac OS X] — MySQL
+
:[http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg MySQL 5.1 for Mac OS X] — for MacOS 10.4-10.6, Intel only, recommended Version
 +
:[http://dev.mysql.com/downloads/mysql/5.5.html#macosx-dmg MySQL 5.5 beta 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 up PHP pages using Apache and MySQL right on their Mac. The two packages differ in the selection of utilities they include, but both of them include their own version of Apache, MySQL, and PHP.
 +
 
 +
These packages are installed by copying the MAMP/XAMPP folder to your 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 for starting and stopping the servers. The utility also allows basic configuration of the servers, including the port MySQL runs on (default is 8889). There is a commercial utility (named MAMP PRO) available for more advanced options. MAMP includes PHP 4 and 5.2, and MySQL 5.1. The download is about '''160MB'''.
 +
:[http://www.mamp.info/en/downloads/index.html Download MAMP/MAMP Pro] — for MacOS 10.4-10.6, Universal binary
 +
 
 +
'''XAMPP''' provides only a utility for starting/stopping the servers. Configuration is performed using command line utilities. XAMPP includes PHP 5.3, MySQL 5.1, and several extras like Perl and an FTP Server. XAMPP weighs in at about '''90MB'''.
 +
:[http://www.apachefriends.org/en/xampp-macosx.html Download XAMPP] — for MacOS 10.4-10.6, Universal binary
 +
 
 +
If you use one of these packages, see [[Connecting to MAMP or XAMPP]] for further instructions.
== Install from Source ==
== Install from Source ==
 +
Installing a copy of MySQL from source is recommended for advanced users only. There are many advantages to compiling your own copy of MySQL — including speed improvements and system specific customisations (eg. for machines with little RAM). Installation from source also gives you access to cutting edge features and bugfixes before a .pkg installer is available.
-
[http://dev.mysql.com/doc/refman/5.0/en/quick-install.html Installing from source] — MySQL
+
You must have the [http://developer.apple.com/technology/tools.html Xcode Developer Tools] installed. Compiling takes  a very long time compared to installing binaries, but you'll only have to download about '''20MB''' of source code.
-
[http://hivelogic.com/articles/view/installing-mysql-on-mac-os-x Installing from source] — Hive Logic
+
-
== MAMP on Mac OS X ==
+
:[http://dev.mysql.com/doc/refman/5.0/en/quick-install.html Installing from source] — MySQL
-
MAMP gives developers an easy way to serve up PHP pages using Apache and MySQL right on your Mac.
+
:[http://hivelogic.com/articles/view/installing-mysql-on-mac-os-x Tutorial for Tiger and Leopard] — Hive Logic
 +
:[http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/ Tutorial for Snow Leopard] — Hive Logic
-
[http://www.mamp.info/en/downloads/index.html Download MAMP/MAMP Pro]
+
== Using MacPorts ==
 +
If you want to install from source, but spare yourself the hassle of configuring the install, you can use Macports to automatically compile and install MySQL. This method works only if you have [http://www.macports.org/ MacPorts] and the [http://developer.apple.com/technology/tools.html XCode Developer Tools] installed. The MySQL download is aproximately '''20MB''' plus dependencies.
-
== MySQL on VPS host ==
+
With MacPorts you can install the MySQL Server by typing the following command in Terminal:
 +
:<code>sudo port install mysql5-server</code>
 +
Afterwards, you must run:
 +
:<code>sudo -u _mysql /opt/local/bin/mysql_install_db5</code>
 +
You can start the server with <code>sudo port load mysql5-server</code> and stop it with <code>sudo port unload mysql5-server</code>.
 +
 
 +
= Mac OS X Server =
 +
 
 +
Mac OS X Server comes with MySQL pre-installed. For instructions on how to enable MySQL, see [[MySQL:Setup_on_Mac_OS_X_Server|Setup on Mac OS X Server]].
 +
 
 +
= Installing MySQL on a Virtual Private Server (VPS) =
'''Slicehost Articles'''
'''Slicehost Articles'''
Line 32: Line 58:
[http://articles.slicehost.com/2009/5/7/debian-lenny-ruby-on-rails-with-mysql Install MySQL on Debian Lenny] <br />
[http://articles.slicehost.com/2009/5/7/debian-lenny-ruby-on-rails-with-mysql Install MySQL on Debian Lenny] <br />
[http://articles.slicehost.com/2007/9/11/debian-etch-mysql-and-ror Install MySQL on Debian Etch] <br />
[http://articles.slicehost.com/2007/9/11/debian-etch-mysql-and-ror Install MySQL on Debian Etch] <br />
 +
 +
'''Mac How To'''
 +
 +
If you having some problems with mac try to read [http://www.mac-how.net Mac How To] articles.

Current revision as of 20:51, 17 January 2011

Contents

Preface: MySQL for the Newbie

Mac OS X doesn'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 webservers and website packages will include a MySQL installation as part of the services they provide, and 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).

Installing MySQL on your own Mac

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 for installing MySQL on your Mac, but only available for Intel processors. MySQL.com offers a standard MacOS installer package that installs the MySQL Server and several command line utilities. The download also includes a system preference pane for starting/stopping the server. You can optionally install a startup item that starts the MySQL server when your computer starts. The download weighs about 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 beta 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 up PHP pages using Apache and MySQL right on their Mac. The two packages differ in the selection of utilities they include, but both of them include their own version of Apache, MySQL, and PHP.

These packages are installed by copying the MAMP/XAMPP folder to your 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 for starting and stopping the servers. The utility also allows basic configuration of the servers, including the port MySQL runs on (default is 8889). There is a commercial utility (named MAMP PRO) available for more advanced options. MAMP includes PHP 4 and 5.2, and MySQL 5.1. The download is about 160MB.

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

XAMPP provides only a utility for starting/stopping the servers. Configuration is performed using command line utilities. XAMPP includes PHP 5.3, MySQL 5.1, and several extras like Perl and an FTP Server. XAMPP weighs in at about 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 further instructions.

Install from Source

Installing a copy of MySQL from source is recommended for advanced users only. There are many advantages to compiling your own copy of MySQL — including speed improvements and system specific customisations (eg. for machines with little RAM). Installation from source also gives you access to cutting edge features and bugfixes before a .pkg installer is available.

You must have the Xcode Developer Tools installed. Compiling takes a very long time compared to installing binaries, but you'll only have to download about 20MB 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 spare yourself the hassle of configuring the install, you can use Macports to automatically compile and install MySQL. This method works only if you have MacPorts and the XCode Developer Tools installed. The MySQL download is aproximately 20MB plus dependencies.

With MacPorts you can install the MySQL Server by typing the following command in Terminal:

sudo port install mysql5-server

Afterwards, you must run:

sudo -u _mysql /opt/local/bin/mysql_install_db5

You can start the server with sudo port load mysql5-server and stop it with sudo port unload mysql5-server.

Mac OS X Server

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

Installing MySQL on a Virtual Private Server (VPS)

Slicehost Articles

Install MySQL on Ubuntu Hardy
Install MySQL on CentOS
Install MySQL on Debian Lenny
Install MySQL on Debian Etch

Mac How To

If you having some problems with mac try to read Mac How To articles.