How to download and install MySQL on Mac OS X
MySQL is the most popular open source database management system. It allows you to quickly download and install and run a powerful database system on almost any platform available including Linux, Windows, and Mac OS X etc.
In this tutorial, I am going to explain how to download and install MySQL on Mac OS X in a few easy steps.
- Download MySQL for OS X
- Unpack download .dmg file
- Install MySQL from downloaded file
- Install and setup auto start package for MySQL on OS X
- Connect to installed MySQL server
Download MySQL for OS X
Download latest stable version of MySQL server for your OS X version and architecture. Link: http://dev.mysql.com/downloads/mysql/. Please make sure you download the .dmg file.
Unpack download .dmg file
Click on the downloaded .dmg file and unpack it. Click on the mysql server package from unpacked files.
Install MySQL from downloaded file
Install MySQL server by clicking on the mysql package to open up the installer. If you want to install the startup script to automatically start MySQL server at the time of system startup, you should also install the start up package of mysql now (included in the unpacked MySQL package that you just downloaded and unpacked as a separate file).
Once the installer has finished successfully, all MySQL related files should be installed under /usr/local/mysql-VERSION directory. A link /usr/local/mysql (pointing to the MySQL installation directory) should also have been created for your convenience.
Install and setup auto start package for MySQL on OS X
If you had installed the automatic startup package at the time of installation, you should now be able to start MySQL running the following command in OS X Terminal window or by restarting the operating system:
$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
As soon as you run the command above, your system might ask for permission to allow MySQL server to accept incoming connections. You must give the permission to listen on port 3306 (or change it later to run on a different port).
In case, you did not install the startup script, you have to run mysqld_safe under /usr/local/mysql/bin/mysqld_safe script.
If you want to disable automatic MySQL starts at the time of system startup, you can change the value of MYSQLCOM in /etc/hostconfig to "-NO-" (without quotes).
You should also consider including /usr/local/mysql/bin/ in your system PATH variable.
Connect to installed MySQL server
In order to connect to MySQL using command line client, do the following from OSX terminal:
$ /usr/local/mysql/bin/mysql -uroot
This will connect you to mysql server. Please make sure that you run mysql_secure_installation after finishing installation to secure your MySQL installation.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.
tags cloud
popular searches
free download for mysql database server 5.1.5, php, linux, mysql mysql, mysql, java, install mysql, gearman, ubuntu, tools, source code, bison, mysql initialization, install cairo, laptop
Similar Tutorials:
- MySQL open files limit: open-files-limit vs open_files_limit on Linux
- Download, configure, compile, and install MySQL 5.5 from source code on Linux
- How to install Python Gearman client module
- How to install MySQL Gearman UDF on Ubuntu/Debian Linux
- Not-so-well-known differences between MyISAM and Innodb MySQL server storage engines
Tutorials in 'Database Management Systems > MySQL' (more):
- Is MySQL 5.6 slower than MySQL 5.5? No, it's faster
- Download, configure, compile, and install MySQL 5.6
- Fast, parallel restore from SQL dumps (mysqldump) for MySQL
- MySQL DATE_FORMAT function and ORDER BY
- MySQL Query Cache not necessarily a bad thing


Comments (write a comment):
as soon as i enter the command
"$ /usr/local/mysql/bin/mysql -uroot"
i get an error as
"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"
i am new to terminal,not getting what to do Posted by: Anurag on Sep 19, 2012