WordPress on Mac Part 3: Installing WordPress

Posted on Thursday, August 25th, 2005 at 2:28 pm under Mac Geekery, Tutorials, Web, Wordpress.

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

Technorati Tags: , , , ,



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.

Pings are open Comments are open Comments RSS

34 Responses to “WordPress on Mac Part 3: Installing WordPress”

  1. gravatar Flag Zach Forrester
    Aug 26th, 2005 at 7:47 pm

    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?

  2. gravatar Flag Melvin - All Forces
    Aug 26th, 2005 at 9:11 pm

    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.

  3. gravatar Flag Benxamin
    Aug 27th, 2005 at 12:03 am

    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.

  4. gravatar Flag Zach Forrester
    Aug 27th, 2005 at 5:17 pm

    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)

  5. gravatar Flag Zach Forrester
    Aug 27th, 2005 at 5:19 pm

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

  6. gravatar Flag Ian
    Sep 7th, 2005 at 7:58 am

    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 :)

  7. gravatar Flag Phil Bowell
    Sep 8th, 2005 at 8:13 am

    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!!

  8. gravatar Flag Melvin - All Forces
    Sep 8th, 2005 at 9:22 am

    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.

  9. gravatar Flag Phil Bowell
    Sep 8th, 2005 at 3:10 pm

    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??

  10. gravatar Flag Melvin - All Forces
    Sep 8th, 2005 at 4:36 pm

    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.

  11. gravatar Flag Phil Bowell
    Sep 9th, 2005 at 3:29 am

    thats the thing though. I can’t get that link to show, nor can I find it in the wordpress file. i have a feeling I may have to go back through it again!! d’oh!!

    Cheers for the guidance as well!!

  12. gravatar Flag Melvin - All Forces
    Sep 9th, 2005 at 7:51 am

    phil, u need to be more descriptive of the problem. what happens when u point your browser to http://philbowell.localhost ?

  13. gravatar Flag Phil Bowell
    Sep 9th, 2005 at 8:29 am

    hehe, sorry!! I get the old URL not found, 404 it says on the tab.

    The requested URL / was not found on this server.
    Apache/1.3.33 Server at philbowell.localhost Port 80

    I’m sure it was working though. I may have to start again. As i believe i should have the install.php link here. I’m just gonna go through the apache setup again!!

  14. gravatar Flag Melvin - All Forces
    Sep 9th, 2005 at 8:46 am

    phil,
    make sure all the wordpress files are in the philbowell folder you specified. your folder should have files like index.php, wp-admin, wp-atom.php etc.

  15. gravatar Flag Phil Bowell
    Sep 9th, 2005 at 8:49 am

    WOO!!!

    I got it working now. Thanks for all your help!! Went back through it all again, including the mysql stuff and it works now. Don’t really know what I had done wrong the first 2 times!!

    Sorry for the hassle!!

    P

  16. gravatar Flag Phil Bowell
    Oct 5th, 2005 at 4:44 am

    Me again!!

    Argh!!

    since upgrading to Tiger, I’ve managed to get safari to find my subdomain, same as before philbowell.hocalhost. However it does not bring up the install wordpress page, which i guess is becuase its been previously installed on my computer. But it does not bring up a page I can use, it gives a list of all the files in that subdirectory but I am unable to get to a wordpress page, it just brings up the code when I click a link.

    If it will be easier to find out what I’m doning my screen name is revolutionphil on AIM

  17. gravatar Flag Mr. David
    Oct 19th, 2005 at 9:17 pm

    Ok, so after many trials and tribulations, I got the thing working… I thought it was very much hopeless, but apparently, I’m more clever than I gave myself credit for.

    Anyways, fantastic tutorial!

    Also, are you going to get into styling the blog? I was wondering if there was any good way to come up with individual styles (like a visual indicator, ie: color coded sections) for each category when it’s displayed on the main page.

    Anything like that at all?

  18. gravatar Flag Brian Koberlein
    Nov 4th, 2005 at 10:38 am

    Nice little set of instructions. I set up wordpress, and it worked in a snap! I don’t use Wordpress for my weblog (yet), but I can start to see the appeal… I’ll have to play around with it more.

  19. gravatar Flag Melvin - All Forces
    Nov 8th, 2005 at 10:10 pm

    phil,
    if all u see is code and not the executed php file then php is not activated. follow tyhe steps on installing php on step 1.

  20. gravatar Flag Melvin - All Forces
    Nov 8th, 2005 at 10:16 pm

    Also, are you going to get into styling the blog? I was wondering if there was any good way to come up with individual styles (like a visual indicator, ie: color coded sections) for each category when it’s displayed on the main page.

    mr. david,
    i will be covering customazing in th future so stay tuned. you can completly customize how a post from category looks like. check out the the loop in action from the wordpress codex.

  21. gravatar Flag Ben
    Jan 26th, 2006 at 12:22 pm

    im stuck. on CocoaMySQl i’ve typed up the localhost and root part but i don’t understand the password part, please help

  22. gravatar Flag iomatic
    Feb 20th, 2006 at 4:35 pm

    So….

    You’re saying this is a testbed environment (what a PITA to get MySQl going, if you don’t have sockets used instead of TCP in Tiger), so that you can publish locally then upload the db (it is the db you’re uploading) to the server? Or…?

  23. gravatar Flag Andy
    Jun 19th, 2006 at 10:32 am

    Hi, I’m trying to setup Wordpress but it dowsn’t works. I did everything suggested in this tutorial but when I try to open “http://wordpress.local” it says that Safari cannot find a server… If I open the “install.php” file, I see a txt page saying that the configuration file is missing. Any suggestions? Thanks

  24. gravatar Flag Shwetank
    Jul 11th, 2006 at 12:16 pm

    I have successfully completed all the steps till creating the database using CocoaMySQL.

    For some reason CocoaMySQL reports “Unable to connect to localhost. Be sure that the address is correct and you have sufficient privleges”

    root password works fine when using terminal..

    Any suggestions?

    Thanks

  25. gravatar Flag Shwetank
    Jul 11th, 2006 at 12:39 pm

    I got it to work, stupid mistake!!!!

  26. gravatar Flag Muskie
    Jul 26th, 2006 at 2:00 pm

    I’ve been trying to get WordPress 2.0.3 to work with PHP5 on my PowerBook with no luck. I suppose I could try an older version of Wordpress but that defeats the purpose partly.

    I’ve also never gotten CocoaMySQl to work. I put the same password and username along with localhost and I can’t connect to MySQL but I can using MySQL Administrator which allows me to create the database, though I also tried the command line, that isn’t the problem for me. The error I get is:

    Your PHP installation appears to be missing the MySQL which is required for WordPress.

    when I try to run install.php for the first time.

  27. gravatar Flag Jonny
    Aug 11th, 2006 at 12:24 pm

    Great 3 part tutorial. Got me up and running in no time. Was disappointed not to find a tutorial part 4 continuing this “How To’. Now I have it set up, I’m keen to learn how to start customising and publish. I notice from the dates though that I am joinging this blogging bandwagon somewhat late.

    Thanks anyway for the great 3 parts and whetting my appetite.

  28. gravatar Flag bk
    Sep 1st, 2006 at 10:59 am

    Great set of tutorials. up and running within 15mins. thanks for sharing!

  29. gravatar Flag László Patai
    Jan 2nd, 2007 at 11:58 pm

    WOOOW!! Thank for the excellent instructions.

  30. gravatar Flag Josh
    Feb 17th, 2007 at 7:34 pm

    This guide worked perfectly, I was so impressed with the ease that I linked your blog/site, to mine so the people that see my blog can experience yours. Hopefully you don’t mind and if you do, let me know and I will remove it.

    Josh

  31. gravatar Flag Rosalina Yukari Yoshida
    Apr 9th, 2007 at 8:07 am

    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.

  32. gravatar Flag Pete
    May 29th, 2007 at 9:39 am

    Yeah, good one!
    But, you seem to have forgotten Step 5: Permalinks!

    Oops..

  33. gravatar Flag Bob
    Jun 10th, 2007 at 1:09 pm

    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.

  34. gravatar Flag Jim
    Jul 13th, 2007 at 11:39 am

    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

Leave a Reply

(not published)


For a personalized fancy icon, sign up at Gravatar.com