Installing MySQL 5.5 on OS X 10.6 (Snow Leopard)

I was successfully able to install MySQL 5.5 on OS X 10.6 according to the following steps.
Download MySQL Community Server 5.5.8 for Mac OS X. I chose to download Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive. The DMG archive is nice as it has a startup package that installs a MySQL control panel (although it dosn’t work from the start without tweaking).
Open the DMG archive and execute the mysql-5.5.8-osx10.6-x86_64.pkg. I had no issues with installation although the ReadMe.txt file suggests that problems may occur.
After successful installation, execute the MySQLStartupItem.pkg. This will install the MySQL Startup startup items. This should complete successfully.
Next, install the MySQL preferences pane by double-clicking the MySQL.prefPane item in the mounted drive. This will install the MySQL preferences item, although MySQL cannot yet be started through it. First, the mysql.server file must be edited by hand to specify the location of the base directory.
At a terminal, cd to /usr/local/mysql/support-files and edit mysql.server (with root privileges, using sudo). Around line 46 locate the lines that read:
basedir=
datadir=
and change them to read
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
Save the file. MySQL can now be started from the preferences pane. Without it, you will see a message in the Console that reads:
??mysql.server: line 256: my_print_defaults: command not found
To enable rails 3 to use mysql, install the mysql2 gem. Next, you’ll need to set the DYLD_LIBRARY_PATH to include the MySQL library directory. To do this, edit your ~/.bash_profile and include the following:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
The rails server will now successfully start. Without the inclusion of the directory in the DYLD_LIBRARY_PATH, a message about not finding the library would appear and the server would abort.
The error message, from the mysql2 gem, states (in part):
Library not loaded: libmysqlclient.16.dylib (LoadError)

thank you Rick !!

Commenti

Post popolari in questo blog

Comando SCP

Tutorial: come usare alcuni servizi e la posta di iCloud su Snow Leopard