Skip to content

Instantly share code, notes, and snippets.

@sks147
Last active April 29, 2019 07:16
Show Gist options
  • Save sks147/545a0570c3c352b97cea6c2ebad3dd19 to your computer and use it in GitHub Desktop.
Save sks147/545a0570c3c352b97cea6c2ebad3dd19 to your computer and use it in GitHub Desktop.
Setup mysql

To install, run:

$ brew update
$ brew install mysql

Usage

To have launchd start MySQL now and restart at login:

$ brew services start mysql

Or, if you don't want/need a background service you can just use the mysql.server tool:

$ mysql.server start

To stop it when you are done, run:

$ mysql.server stop

You can see the different commands available for mysql.server with:

$ mysql.server --help

To connect with the command-line client, run:

$ mysql -u root --skip-password

$ mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';

To fix Client does not support authentication protocol

$ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'
$ flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment