Installing MySQL and then running is not same as you are installing and running MySQL on windows. When I first time installed MySQL on Mac I was not getting any clue how to start it. I am writing down the post to help beginners who want to set up MySQL on MAC.
In the next step you can skip the login and directly download the file. Once the file is downloaded, double click and it will start the installation process. Once the process, it will prompt you the password for the root. Please note down the password, this password is used to login into the database.
Connecting to server
To connect the server, go to system preferences and click on mysql and click on Start MySQL server. This will promote you to enter Mac system password, once you enter the password. The database will up and running.
Once the MySQL is running open the terminal window and go the bin directory of the mysql, by typing the following command cd /usr/local/mysql/bin;. Once you are in the bin directory type the following command in terminal and hit enter ./mysql -u root -p. It will ask for the password, enter the same password which was promoted after the database installation completed. Once you successfully logged in, the first thing is to change the default password. Execute the following command to set a new password for the user root SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new password here'); . Try execute the following query in terminal window to test the server mysql> SELECT VERSION(), CURRENT_DATE; .
To close the server type QUIT on the terminal window and you will be disconnected from the server.