Skip to content

Instantly share code, notes, and snippets.

@vochicong
Forked from jnoss/mysql_macosx.md
Created August 10, 2017 00:05
Show Gist options
  • Save vochicong/597f0a2bf06288511bae49957760a957 to your computer and use it in GitHub Desktop.
Save vochicong/597f0a2bf06288511bae49957760a957 to your computer and use it in GitHub Desktop.
mysql on mac osx

Install and run mysql on mac os x

Instructions for installing mysql on mac os x via homebrew (a command line package manager for mac)

Install brew

Follow installation instructions at https://brew.sh/

Install mysql

Run this at a terminal prompt: brew install mysql

secure mysql installation

Run this at a terminal prompt: mysql.server start

Then run: mysql_secure_installation

and provide a strong root password. I'd recommend setting the Strong (2) requirement for passwords, and also saying Yes to all of the prompts - remove anonymous users, disallow root login remotely, remove test database, etc.

If you don't need mysql at the moment, stop it

Run this at a terminal prompt: mysql.server stop

To start mysql later, run

Run this at a terminal prompt: mysql.server start

If you want it to always start, run this:

Run this at a terminal prompt: brew services start mysql

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