Sunday, July 13, 2014

MySQL - install on mac OSX

Installing MySQL using homebrew is the easiest way

$brew install mysql
Note: Perform a secure installation , else all log ins will be as an anonymous user.
DO: A secure installtion.
$mysql_secure_installation
The default root password is empty, so press "Enter" when prompted. Enter the new password that need to be assigned to the root user.

Errors: 
1.Command not found: mysql_secure_installation
The error clearly states that the command is not found. But we are sure that our installation was correct. To quickly rectify it, find where the command actually resides.
Do $which mysql_secure_installation

> /usr/local/bin/mysql_secure_installation

$cd /usr/local/bin -> Now continue with the previous step.

To login into mysql as root,
$mysql -uroot -p
Enter the password on prompt

Voila!

P.S. For beginners: The commands to be typed into the terminal, are italicized. $ refers to the command prompt, do not enter it in the terminal.