How to install and configure a mysql basic setup in OSX

In order to install MySQL in OSX, follow this process

Process

1. Download the dmg file from http://dev.mysql.com/downloads/mysql/

2. Open the dmg file and install it through the installer

3. Start the MySQL server with the next command

sudo /usr/local/mysql/support-files/mysql.server start

​4. Add these lines to the .bash_profile within the user´s home directory

alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin

Configuration file my.cnf

1. In order to find the proper location execute the next command

mysql --verbose --help | grep my.cnf​

2. Create the my.cnf from as a copy of the file my-default.cnf

/usr/local/mysql/support-files/my-default.cnf

Note

To Start/stop/restart MySql from the command line please use this commands

Start

sudo /usr/local/mysql/support-files/mysql.server start

Stop

sudo /usr/local/mysql/support-files/mysql.server stop

Restart

sudo /usr/local/mysql/support-files/mysql.server restart