Symptoms:
MassTransit Engine will not start after upgrading server to 10.4.4 and above.
Steps to Reproduce:
Install or upgrade MassTransit 5.1 or 6.0 on Mac OS X Server 10.4.x Tiger. Launch MassTransit Engine.app and the icon bounces on the Dock and then stops, The message below appears in either a dialog box or your console window.
MassTransit[475]: SA_Exception [2002]: CreateDb: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)\n [DbManager]
Cause:
A version of MySQL is installed by default on Mac OS X Server 10.4. This version is configured to write the default connection socket file to: /var/mysql/mysql.sock. Apple recommended that this configuration be changed with Mac OS X Server 10.4.4 so that the socket file is written to /tmp. This change is preferred since /tmp clears with a reboot. The previous location would leave the file in /var/mysql preventing MySQL from restarting after a crash.
Workaround:
The Apple Knowledge Base article below details the recommended changes to MySQL's socket location to /tmp in addition to other related changes:
http://docs.info.apple.com/article.html?artnum=301457 Mac OS X Server 10.4: Issues connecting PHP to MySQL
When running MySQL and PHP on the same Mac OS X 10.4 server, you may find that PHP cannot connect to MySQL. When PHP is communicating with a MySQL server on the same host, it uses a socket file to communicate, and looks for it at /tmp/mysql.sock. On Mac OS X Server 10.4, MySQL creates this socket file at /var/mysql/mysql.sock.
To resolve this issue, you can either change the location where MySQL creates its socket file, or modify the location where PHP looks for the file. Please note that the first option is less secure than the second. Before delving in, you should also review new information relevant to PHP and MySQL on Mac OS X Server 10.4.4 and later.
To change the location where MySQL creates its socket file, do this:
- Open your preferred text editor and create a plain text file.
- Type this text (on two lines as shown):
[mysqld]
socket=/tmp/mysql.sock - Save the file as: /etc/my.cnf
To change the location where PHP looks for the socket file, follow these steps:
- 1) In Terminal: sudo cp /etc/php.ini.default /etc/php.ini
- 2) Open /etc/php.ini in your preferred text editor.
- 3) Find the [MySQL] section, and change the mysql.default_socket directive:
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket = /var/mysql/mysql.sock - 4) Change the permissions on /var/mysql so that www can read the socket, by executing this in Terminal:??sudo chmod 775 /var/mysql
For additional information regarding Mac OS X Server 10.4.4 and MySQL/PHP, refer to the Apple Knowledge Base article below: