HowTo: Installing PostgreSQL and MySQL on the same Mac OS X machine
If you're interested in helping to ensure that Drupal and its contributed modules are compatible with both MySQL and PostgreSQL (also known as "pgsql"), you should consider setting up local test sites using both database back ends on the same machine. You can even configure both sites to point to the same Drupal installation, using symbolic links.
Unfortunately, the version of PHP that ships with Mac OS by default is not compatible with PostgreSQL, so to do this, you will need to compile both pgsql and php from source. While you're at it, you might want to upgrade to a newer version of MySQL, as well.
- Make a directory where you can build all of these programs. For example:
mkdir /usr/local/src
cd /usr/local/src
- PHP -- http://www.php.net/downloads.php
- MySQL -- http://www.mysql.com/downloads
- PostgreSQL -- http://www.postgresql.org/download
--prefix flag. For example: ./configure --prefix=/usr/local/mysql
--prefix flag. For example: ./configure --prefix=/usr/local/pgsql
./configure --with-pgsql=/usr/local/pgsql --with-mysql=/usr/local/mysql --with-apxs --with-kerberos=/usr --with-zlib-dir=/usr --enable-cli --enable-trans-sid --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql-sock=/var/mysql/mysql.sockSome noteworthy things about this command:
- This matches the flags used for the default PHP installed on Mac OS X as closely as possible, while also enabling PostgreSQL support.
- The path you use for
--with-pgsqlmust match whatever you specified for--prefixwhen building PostgreSQL. - The path you use for
--with-mysqlmust match whatever you specified for--prefixwhen building MySQL. - The path you use for
--with-mysql-sockshould match whatever you specified for--with-unix-socket-pathwhen building MySQL.
Additional information about building PHP on Mac OS X machines can be found on the developer.apple.com site: PHP on Mac OS X
