Skip to content

Instantly share code, notes, and snippets.

@automaticalldramatic
Last active December 24, 2015 09:38
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 automaticalldramatic/6778100 to your computer and use it in GitHub Desktop.
Save automaticalldramatic/6778100 to your computer and use it in GitHub Desktop.
A gist of all important brew command to run on a new machine. I like brew and its the only (hence the best) package manager available on a mac. I still prefer the synaptic package manager compared to homebrew

Homebrew setup on a new mac

Install HomeBrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Get updates from http://brew.sh/

After brew is installed, go to your /etc/paths/ and move /usr/local/bin/ above /usr/bin/. Restart terminal and you are good to go.

MariaDB

MariaDB is an enhanced, drop-in replacement for MySQL, which means that it's completely compatible with MySQL. You do not have to change any functions to use MariaDB instead of Mysql, it will just work fine. Install MariaDB using the following commands:

$ brew install mariadb

When MariaDB is installed, we need to install the databases, therefore issue following commands:

$ unset TMPDIR
$ mysql_install_db --user=`whoami` --basedir="$(brew --prefix mariadb)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

MariaDB comes with a standard login "root" and the password "root". If you'd like to change this you can run this command:

$ '/usr/local/opt/mariadb/bin/mysqladmin' -u root password 'new-password'

Or, if you don't want this to be in your ~/.bash_history file, you might rather use:

$ '/usr/local/opt/mariadb/bin/mysql_secure_installation'

Now, to start the MariaDB server you can run:

$ mysql.server start

Or, if you want your server to boot when you login to your computer issue this command once:

$ ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents

PHP 5.*

Refer to https://github.com/Homebrew/homebrew-php - JoseGonzalez has merged his repo with homebrew.

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