All Forces

Design, Music & Mac Geekery

WordPress on Mac Part 3: Installing WordPress

34 Comments
by Melvin Rivera
Updated: Oct 17th, 2009

This guide will help you run WordPress(the blog app that runs this website) in your own personal Mac for testing purposes or for backing up your blog. On WordPress on Mac – Part 1: PHP & Mysql we covered installing PHP and MySQL. On WordPress on Mac Part 2: Sub-Domains we covered setting up local sub-domains. On Step 3 we’ll cover how to install WordPress.

Installing WordPress

The steps we’ll take:

Step 1: Download and Install CocoaMySQL
Step 2: Create Database
Step 3: Download WordPress
Step 4: Install WordPress
Step 5: Permalinks

Step 1: Download and Install CocoaMySQL

WordPress will create the necessary database tables but we do need to create a database for it to do this. We’ll do this with CocoaMySQL, a cocoa application for editing the MySQL database content.

Download CocoaMySQL
Go to CocoaMySQL’s website and choose the latest binary file for download. On the next page, choose the file icon to download the file from the closest server.

CocoaMySQL website CocoaMySQL Server Downloads

Once downloaded, double click the disk image file if it hasn’t mounted yet. From the mounted disc, drag the CocoaMySQL application icon to your Applications folder, unmount the disk icon from the sidebar and delete the disk image you downloaded.

CocoaMySQL Mounted Disk

Step 2: Create Database

From the Application’s folder in the Finder, double-click CocoaMySQL to launch it.

CocoaMySQL Application Icon

The firs this you’ll see once you launch CocoaMySQL is the connection window. To connect to your local MySQL database use the following settings.

CocoaMySQL Coonection

host: localhost
user: root
password: blank (unless you password protected it)

CocoaMySQL is a very cool app but for now, all we need to do is create a database. From the Databases area, clik on the “Add database” on the right. From the pop up window, write the name you would like for your database. I’m using wordpress for this example but I usually use the name of my project if the database will hold all things regarding a project, not just wordpress. Once you add the new database, quit the CocoaMySQL.

CocoaMySQL Add Database Button CocoaMySQL Database Name

Step 3: Download WordPress

Point your browser to the WordPress website and download the latest version of WordPress (1.5.2 at the moment).

WordPress website

Move the contents of the WordPress folder to the location you specified in the sub-domain. Check out WordPress on Mac Part 2: Sub-Domains if you haven’t read it yet. In our example, we created a sub-domain called http://wordpress.localhost and linked it to the folder “/Users/myusername/Sites/Projects/wordpress”. So all the wordpress files go in that folder.

WordPress Location

Step 4: Install WordPress

First, we’ll need a proper configuration file. In the WordPress folder, find the file “wp-config-sample.php” and rename it to “wp-config.php” and open it for editing. You can edit this file in TextWrangler or any other text editing app. The part we’re concered about is the MySQL settings area. In there enter the database name, database username, password and host like the example bellow.

// ** MySQL settings ** //
define(‘DB_NAME’, ‘wordpress’); // The name of the database
define(‘DB_USER’, ‘root’); // Your MySQL username
define(‘DB_PASSWORD’, ”); // …and password ( if you protected mysql )
define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

WordPress Configuration File

Now, point you browser to your sub-domain. In my example it’s “http://wordpress.local”. The browser will give you the following statement:

It doesn’t look like you’ve installed WP yet. Try running install.php.

Click on the install.php link to begin the installation of the WordPress database.

WordPress Installation: First Step

Enter the title of your Blog an the admin’s email address. This can all be changed later.

WordPress Enter Title

This screen tell you weather the installation of the database was successful or not. If it was successful it will give you the username and password for the admin. These can be changed once you log in as well.

WordPress Install Success

Click on the Login link to go to the admin login window.

WordPress Login Window

That’s it. WordPress is installed! Click on the “Back to Blog” link to view your blog.

WordPress Default Installation

Your blog address is the sub-domain you selected. In our example it’s “http://wordpress.localhost”. To go to the WordPress admin area, add wp-admin to the URL “http://wordpress.localhost/wp-admin”.

On the next installment, we’ll cover configuring WordPress. Until then, happy blogging.


34 Comments

  • woop.. okay, more problems. after i edit wp-config, and go to http://mactutorials.localhost (mactutorials being my domain name) i still get sent to the “FORBIDDEN: You don’t have access…” page. whats up with that?

  • make sure the folder is located somewhere in the Sites folder of your home folder and make sure “Others” can Read in the Ownership & Permissions of the Get Info panel on the Finder.

  • Benxamin says:

    Wow! I ‘ve been curiously following this all week. After a tad bit of confusion on the MySQL Config part (I changed the DB_VARS instead of the ‘lower case vars’), I got it up and running!

    A client’s good-natured webmaster taunted me about LAMP vs. MAMP back in March. Now I have a better understanding as well as a bit of a retort.

    Thank you for sharing this. I’ve always known OS X had this potential; I just didn’t know where to begin.

  • hmm… still no worky. I’ve got it set up in zach>sites>projects>mactutorials and all the wordpress files are in a folder called wordpress inside the mactutorials folder… is that a problem? Ownership and permisions are set group:read only, others: read only… good? (PS, thanks for all the help so far)

  • question two: is there any quick way to backtrack and make sure all my spellings are correct? this could be problematic ;)

  • Ian says:

    Hey Melvin, this is shaping up to be a really useful WordPress/PHP primer. I’ve pointed a few Windows-types at these articles to show them how simple web dev work is on the Mac. Lookin’ forward to part 4 :)

  • Phil Bowell says:

    I’m having some issues with getting this to show up:-

    It doesn’t look like you’ve installed WP yet. Try running install.php

    but the annoying thing is I have no idea what i’m doing wrong!! I just wanna get it sorted to make blog look better!!

  • if u follow directions up to this point (starting from step 1 of the guide) you should have wordpress installed. the next step will be configuring and modifying wordpress. but it should be running by now. play close attention to each step. i tried to be as thorough as possible.

  • Phil Bowell says:

    As far as I know I have. I think I’m going wrong on this bit

    // ** MySQL settings ** //
    define(’DB_NAME’, ‘wordpress’); // The name of the database
    define(’DB_USER’, ‘root’); // Your MySQL username
    define(’DB_PASSWORD’, ‘’); // …and password ( if you protected mysql )
    define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    I set the databse bit to what i called it philbowell where it says wordpress in yours. I dont have a password, and i’m sure i called it root earlier on, but it doesnt seem to work. Anytips??

  • phil. you are good so far. you do need to click on that install.php link so that wordpress can install the proper database tables.

Leave a Reply


Contact Me