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.

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.

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.

Step 2: Create Database
From the Application’s folder in the Finder, double-click CocoaMySQL to launch it.
![]()
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.

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.

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

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.

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

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.

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

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.

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

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

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.
Hello, I am Melvin Rivera; creator of
Follow me @


Hello Melvin! I was going through the installation and when that CocoaMySQL connection window came I typed as said and this message appeared and I couldn’t continue:
Unable to connect to host localhost.
Be sure that the address is correct and that you have the necessary privileges.
MySQL said: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
Did I do something wront?
Note that I’m almost completely naive about web development.
Thanks in advance and I like the look of your site.
Yeah, good one!
But, you seem to have forgotten Step 5: Permalinks!
Oops..
Thanks for the tut. Kept me busy for the btter part of the day. Unfortunately it’s a pain in the ass with permalinks. I imported my blog’s 30M db but it’s unworkable. Evey link I use takes me online :) Thanks for the experience anyway.
A truly awesome explanation so far!
But for some reason CocoaMySQL reports “Unable to connect to localhost. Be sure that the address is correct and you have sufficient privileges”
Im not the most web savvy guy and im quite gutted i cant overcome what appears to be pretty simple compared to the last part of the tutorial.
All help much appreciated many thanks