MySQL (Percona) and homebrew: I'm trying to run MySQL server (Percona) by launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.percona-server.plist and I see the following message in /var/log/system.log:

Aug  9 01:36:14 xxx com.apple.launchd.peruser.501[253] (homebrew.mxcl.percona-server[37257]): Exited with code: 1
Aug  9 01:36:14 xxx com.apple.launchd.peruser.501[253] (homebrew.mxcl.percona-server): Throttling respawn: Will start in 10 seconds


If I run it manually it gives me

$ /usr/local/opt/percona-server/bin/mysqld_safe
130809 01:49:36 mysqld_safe Logging to '/usr/local/var/mysql/xxx.local.err'.
130809 01:49:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
/usr/local/opt/percona-server/bin/mysqld_safe: line 135: /usr/local/var/mysql/xxx.local.err: Permission denied
/usr/local/opt/percona-server/bin/mysqld_safe: line 172: /usr/local/var/mysql/xxx.local.err: Permission denied
130809 01:49:36 mysqld_safe mysqld from pid file /usr/local/var/mysql/xxx.local.pid ended
/usr/local/opt/percona-server/bin/mysqld_safe: line 135: /usr/local/var/mysql/xxx.local.err: Permission denied


Any ideas?
The log says it all: The script cannot write to the file /usr/local/var/mysql/xxx.local.err due to insufficient permissions.

I assume the log file belongs to a dedicated mysql user while you are starting the process using your user account.