Installing MySQL Database on Ubuntu or CentOS is a trivial operation as long as they have nice package managers as Aptitute and YUM. Otherwise, in Mac OS X is a hard operation from downloading the correct package, apllying with several steps and it can break the whole install, if you
But, with Homebrew, the install is near the same as in Linux. Homebrew acts as a package manager in Mac OS X and always keeps your system updated. If you don’t have yet installed in your Mac, see how to install and manage it.
In your Mac OS terminal, type the command:
$ brew install mysql
And Homebrew downloads and installs MySQL in your Mac, however MySQL will not start automatically when you reboot your computer, for that let’s just create a symbolic link from the just installed MySQL to the launch folder:
$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
After that, just start the MySQL Server:
$ mysql.server start
Now MySQL is running! To access it, just type:
$ mysql -u root
And you are in the MySQL Console! If you take attention, you didn’t enter a password to access MySQL Console, it happens because the default configuration install root user with empty password. It’s strong insecure and you should follow our security best practices.