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.

No comments: