Wednesday, May 28, 2008

Installing and setting up a fink installed MySQL with a non-default data directory

So I assume you have successfully executed: sudo fink install mysql

Create or edit /etc/my.cnf and add or change the keyword datadir to the directory you want e.g.

[mysqld]
datadir=/Volumes/another/directory
[mysqld_safe]
datadir=/Volumes/another/directory

During installation, Fink set up some files and directories in /sw/var/mysql.  Copy the contents of this directory to your new directory e.g.

sudo cp -r /sw/var/mysql/* /Volumes/another/directory

Go to /Volumes/another/directory and set the owner of all contents to mysql e.g.
sudo chown -R mysql /Volumes/another/directory.

At this point you should be able to run 'sudo mysqld_safe.'

Saturday, May 17, 2008

fink Mysql on Macbook OSX 10.5 leopard

I installed mysql from fink and received some unwelcome news.

My-MacBook:~ me$ sudo mysqld_safe
Password:
chown: mysql: Invalid argument
Starting mysqld daemon with databases from /sw/var/mysql
STOPPING server from pid file /sw/var/mysql/My-MacBook.local.pid
080517 14:39:45 mysqld ended

After looking at /sw/var/mysql/My-MacBook.local.err, it seemed I was missing the user mysql. So I snooped around google and found the answer. Based on this, I executed the following commands:

sudo dscl localhost -create /Local/Default/Users/mysql
sudo dscl localhost -create /Local/Default/Users/mysql NFSHomeDirectory /var/empty
sudo dscl localhost -create /Local/Default/Users/mysql Password '*'
sudo dscl localhost -create /Local/Default/Users/mysql PrimaryGroupID 74
sudo dscl localhost -create /Local/Default/Users/mysql RealName "MySQL Server"
sudo dscl localhost -create /Local/Default/Users/mysql UniqueID: 74
sudo dscl localhost -create /Local/Default/Users/mysql UserShell: /usr/bin/false
My next attempt to start mysqld_safe gave me some more bad news:

My-MacBook:var me$ sudo mysqld_safe Password:
chown: mysql: Invalid argument
Starting mysqld daemon with databases from /sw/var/mysql
STOPPING server from pid file /sw/var/mysql/My-MacBook.local.pid
080517 17:11:24 mysqld ended

This one was easy though. Just go to /sw/var and execute chown -R mysql mysql. You should be good to go from here. sudo mysqld_safe& should work just fine.

Wednesday, May 14, 2008

Adobe Flex license key Leopard OSX

If you ever receive a message like "License key is invalid" when you enter in your valid license
for Adobe Flex on OSX, try switching to an admin account. For some reason when you enter the license key into Flex Builder (or the Eclipse plug-in) under a non-admin account, you cannot 'activate' the installation.

Saturday, May 10, 2008

gem install mysql mac osx leopard

gem install mysql -- --with-mysql-config=`which mysql_config`

Also you may need some additional hacking to get it all working.