O'Reilly logo

Mac OS X Panther for Unix Geeks, Second Edition by Ernest E. Rothman, Brian Jepson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. MySQL and PostgreSQL

Although there are some great binary distributions for MySQL and PostgreSQL, both build out of the box on Mac OS X. This chapter describes how to install them from source and get them set up so you can start playing with them. Fink is a good first stop for MySQL or PostgreSQL, since you can use it to install a binary build or compile from source.

You can also get MySQL as a binary package from MySQL AB (http://www.mysql.com), as well as Server Logistics (http://www.serverlogistics.com/). Server Logistics offers a selection of open source packages, one of which is Complete MySQL (http://www.serverlogistics.com/mysql.php), which includes the MySQL server, a System Preferences pane for MySQL, ODBC/JDBC drivers, and documentation.

MySQL

To get the source distribution of MySQL, download the latest tarball from http://www.mysql.com/downloads/. At the time of this writing, the latest production release was the 4.0.x series; we downloaded mysql-4.0.16.tar.gz.

Compiling MySQL

To compile MySQL from source:

  1. Extract the tarball:

    $ cd ~/src
    $ tar xvfz ~/Desktop/mysql-4.0.16.tar.gz
  2. Change to the top-level directory that tar created and run the configure script. We suggest specifying a prefix of /usr/local/mysql so it stays out the way of any other binaries you have in /usr/local.

    $ cd mysql-4.0.16
    $ ./configure --prefix=/usr/local/mysql
  3. Next, type make to compile MySQL. Go get a few cups of coffee (compiling could take 30 minutes or more).

Installing MySQL

If the compilation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required