Skip to content

Instantly share code, notes, and snippets.

@gembin
Last active April 16, 2020 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gembin/24649fcefb046bd91a9b41f7d2c4497c to your computer and use it in GitHub Desktop.
Save gembin/24649fcefb046bd91a9b41f7d2c4497c to your computer and use it in GitHub Desktop.
Install MySQL on MacOS

Install

brew install mysql
brew tap homebrew/services
brew services start mysql

Configuration

If you run into this error using GUI tools, e.g. Sequel Pro:

Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

Then do the following steps:

vi /usr/local/etc/my.cnf in section [mysqld] add line:

default-authentication-plugin=mysql_native_password

Login to mysql with mysql -u root -p:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';

And then restart:

brew services restart mysql

Stop

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