Advertisement
Tech

Installing MySQL on Mac OS X

This article takes you through all the steps you need to install and set up MySQL on your Mac OS X system.

By Finn Orfano
Desk Tech
Reading time 2 min read
Word count 333
MAC platform Computing Mactips
Installing MySQL on Mac OS X
Advertisement
Quick Take

This article takes you through all the steps you need to install and set up MySQL on your Mac OS X system.

On this page

Download The Package

First of all you need to download the MySQL installation package from the MySQL website . Go to the website and click on the download link. Choose the package download for your version of Mac OS X. For recent Macs you can use the x86_64 version.

Install All The Package Contents

After downloading the package, install it on your machine. Also run the MySQL.perfPane and MySQL.Startupitem files from the installation package. These programs will start the database automatically on system start up and allow you to control this.

Advertisement

Check Whether MySQL Is Really Running

After installing MySQL, open the MySQL preferences to check whether the database is running.

Setup The Command Line Tools

After the installation of MySQL, one of the things to do is setting of the paths for MySQL command line tools. To set the paths, open a terminal window (from the Utilities folder) and enter the following command:

Advertisement

echo ‘export PATH=/usr/local/mysql/bin:$PATH’ » ~/.profile

Set A Password On Your Database Server

It is best to disable the default database root user and add a new user. You can add many databases and users, depending on your requirements.

Advertisement

At this point, we’ll set a password to the root user. To do this, open a terminal window and type:

mysqladmin -u root password YourNewPassword

Advertisement

To change the initial password sometime in the future, use the following command

mysqladmin -u root -p YourOldPassword password YourNewPassword

Advertisement

Note: Replace YourOldPassword, YourNewPassword with the actual passwords

Set Up The Manual Pages

If you need any sort of help in using the command line tools, the manual pages are a useful resource for guidance. The manual pages come with MySQL but are not completely set up by the installation. Setting up the manual pages is a one minute job. Just open the terminal again and enter the following commands:

Advertisement

MANPATH=/usr/local/mysql/man:$MANPATH’ » ~/.profile

sudo /usr/libexec/makewhatis

Advertisement

If all went successfully, you will be able to access the manual pages by entering man myql in the terminal window.

Keep Exploring

More from Tech

Filed under
MAC platform Computing
More topics
Mactips
Advertisement