Mac : Installing Mysql on mac using brew

Look, if you just want to try out mysql only for learning then there is not need for local installation, you can try it out free at this site : http://demo.phpmyadmin.net/master-config/

If you want to install Mysql on you mac machine then follow below steps :

  1. Install mysql with brew install mysql
  2. Start mysql with mysql.server start
  3. Connect mysql with mysql -uroot 
  4. Stop mysql with mysql.server stop

 

Note :

To have launchd start mysql at login:

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

Then to load mysql now:

  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Or, if you don’t want/need launchctl, you can just run:

$   mysql.server start

$ mysql -uroot

mysql.server stop

Once Mysql is installed you can check port number using below command

mysql> SHOW GLOBAL VARIABLES LIKE ‘PORT’;

+—————+——-+

| Variable_name | Value |

+—————+——-+

| port          | 3306  |

+—————+——-+

1 row in set (0.00 sec)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s