Installing MySQL on OSX

I’ve been making great progress on my app! However, I have noticed some issues where my local Dancer server has issues connecting to the MySQL database hosted by my web host. Browser requests made to Dancer just kind of freeze.

nn

I decided then to install and use a local copy of MySQL. Not only will this stop the hung request issue, but I can now work on the project offline and learn a bit about database and MySQL administration.

nn

Here are the instructions that I followed:

nn

Install MySQL from binary pkg

nn

Download the binary .DMG file from MySQL and install the database .PKG.

nn

Install the MySQL startup item

nn

I admit that I don’t really know what this is or where it goes, but its probably some convenience daemon or something to start the MySQL database on system start up, if one so chooses. The installer is in the same .DMG file.

nn

Install the MySQL preference pane

nn

A handy interface accessible from System Preferences for starting and stopping the database. The installer is in the same .DMG file.

nn

Update your PATH, or add aliases

nn

The /usr/local/mysql/bin has the applications for running and administering your database. Add it to your path so you can easily run these applications.

nn

shell> vi ~/.bash_profilen

nn

Then add the line:

nn

export PATH=$PATH:/usr/local/mysql/binn

nn

Run your profile:

nn

shell> source ~/.bash_profilen

nn

Update the database root password

nn

For security, you know.

nn

shell> mysqladmin -u root password "newpwd"n

nn

Double-quotes are optional.

Leave a Reply

Your email address will not be published. Required fields are marked *