It took me a bit longer then I first anticipated but I got most of the setup working on MySQL 5.5.x out of the box. First I struggled a long time at compiling it properly and found out when I had solved it that you no longer need to compile MySQL. Which is excellent news as it simplifies the setup and a lot of the problems I see here from users.

So here is a quick overview of people who are eager to use MySQL 5.5.x, I will update the other stuff over the next few weeks accordingly. By the way I’ve only done this on Snow Leopard, the Leopard version is only available for Intel, so no more PPC support from MySQL.

First get the binary installer package for MySQL 5.5.x from here (I’ve used 5.5.8) and install only the software (no preference pane or startup item).

If you haven’t installed Apache yet now is a good time. (Installing Apache)

Next up is PHP, this requires a new compilation instruction. From now on we will use the native MySQL driver for compilation. Which means changing:

–with-mysql=/usr/local/mysql
–with-pdo-mysql=/usr/local/mysql
–with-mysqli=/usr/local/mysql/bin/mysql_config

into:

–with-mysql=mysqlnd
–with-pdo-mysql=mysqlnd
–with-mysqli=mysqlnd

In all the compilation instructions found here and it all will compile perfectly.

For Postfix and Dovecot we require a bit of a workaround to get it working properly as the MySQL installation does not correctly sets the full library paths. You can see this when you execute the command:

otool -DX /usr/local/mysql/lib/libmysqlclient.dylib

You can correct it by executing the following command:

sudo install_name_tool -id /usr/local/mysql/lib/libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.dylib

If you’ve done this you can compile Postfix and Dovecot using the existing instructions without any problem.