Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install and Running MySQL in OSX

Install and Running MySQL in OSX

Install MySQL

$  uname -a
Darwin bebop.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
$ xcode-select -v
xcode-select version 2339.
$ brew -v install mysql
$ mysql_config --version
5.6.24

Configure

create the data directory

$ mkdir mysqldb
$ cd mysqldb
$ pwd
/tmp/mysqldb
[mysqld]

log_bin = 1
basedir = /usr/local/Cellar/mysql/5.6.24/
datadir = /tmp/mysqldb
log_error = /tmp/mysqldb/error.log
port = 3306
socket = /tmp/mysqldb/my.sock
explicit_defaults_for_timestamp
lower_case_table_names=2

Install Initial DB data

$ cd /usr/local/Cellar/mysql/5.6.24/
$ ./bin/mysql_install_db --basedir=$(pwd) --datadir=/tmp/mysqldb --defaults-file=/tmp/mysqldb/my.cnf

Running

$ mysqld_safe --defaults-file=$(pwd)/db/my.cnf

fin!

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