MySQL is world’s most widely used open source relational database management system. MySQL database is written in C, C++ and it is available for Mac OS X, Linux, Windows, Solaris, FreeBSD.
Since it is easy to use and can be scaled easily, MySQL is the popular choice of database in web applications whose software stack is LAMP (Linux, Apache, MySQL, Perl/Python/PHP). MySQL can handle million records and further scalability can be achieved by partitioning the table. Even large scale websites like Facebook, Twitter, Flickr and Youtube etc use MySQL database.
MySQL does not comes with any GUI tools to administer but rather comes with command line tool, which can be used to create and manage database. There is official MySQL workbench which is GUI tool which can be installed separately, used to create and administer MySQL databases visually, but most developers including me prefers command line.
How to download & install MySQL in Mac OS X
MySQL is available for OS X 10.10 Yosemite, OS X 10.9 Mavericks, OS X 10.8 Mountain Lion, OS X 10.7 Lion, however its installation process is little lengthy as compared to other applications. Please follow steps given below to install MySQL in Mac.
Step 1: Got to download page of MySQL and download MySQL according to your version of OS X (for people who have Mac OS X 10.10 Yosemite in their mac can download MySQL for Mac OS X 10.9, it works just fine). Download “Mac OS X DMG Archive“, as it makes installation process more easy.
Step 2: Open downloaded file mysql*.dmg, and then open mysql*.pkg file to start installation process.
Step 3: Now follow the steps in installation window and enter your mac’s password when prompted.
Step 4: When the installation will be completed you will see something like this.
Step 5: Open your Terminal (press F4 -> Terminal), and type the following command
mysql -u root
if you get MySQL command line interface, then your installation is completed
or if you get message like
-bash: mysql: command not found
Step 6: If you get above message then its because mysql is not included in your path and you need to include it in your environment path. You can do this by typing following command in your terminal
sudo export PATH=$PATH:/usr/local/mysql/bin
“/usr/local/mysql/bin” is the directory in my mac where MySQL is installed. To check if it installed enter the step 5 command.
If you have any issues or suggestion please let me know by posting them in comments. Enjoy