MySQL

We'll start with MySQL, as it's the easiest.

brew install mysql

This will install the latest version of MySQL and the command-line tools to connect. By default this installs MySQL server with no root password but locks it to localhost (so only local users can access it anyway), I deem this secure enough for my local environment. If you do want to secure it further, you can run mysql_secure_installation, provided by brew after installation.

To test this is working you can then type

mysql -u root -e 'STATUS'

NOTE: Add -p to the end of the command if you did setup root with a password.

Note: You will also be alerted that the certificate is insecure, and have to click Advanced > Proceed to yoursite.dev, this is the only caveat with self signed certificates, and not really avoidable on development environments.

Ok let's check the nginx config and then launch. (we have to launch nginx as root so that it can use port 80.)