Skip to content

Instantly share code, notes, and snippets.

@iplus26
Last active July 9, 2019 15:23
Show Gist options
  • Save iplus26/f2b0a63e9683781fdd3068d98c3405a6 to your computer and use it in GitHub Desktop.
Save iplus26/f2b0a63e9683781fdd3068d98c3405a6 to your computer and use it in GitHub Desktop.
Install MySQL using Homebrew in macOS 10.11 El Capitan

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.

ISSUE 1

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.

ISSUE 2

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!
@dvirarad
Copy link

dvirarad commented Apr 3, 2018

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment