First of all, follow the tutorial: Uninstall all those broken versions of MySQL and re-install it with Brew on Mac Mavericks and let's see what we'll face.
When I trying to run
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
I get this error:
mysql_install_db: [ERROR] unknown variable 'tmpdir=/tmp'
According to this answer on SO, try:
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
And it works fine.
When I run: mysql.server start
, and I got:
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/IVANXFJIANG-MC0.pid).
The solution is simple! Just tap these lines in your terminal:
cd /usr/local/var/mysql
sudo rm *.err && sudo rm *.pid
sudo reboot
sudo mysql.server start
And you'll get
Starting MySQL
. SUCCESS!
Thanks