In a previous tutorial we went through the process of Setting Up a Local Server Using MAMP for Mac OSX. If you have not setup a local server environment, then please refer to that tutorial before proceeding further. If you have a local server environment already setup, please continue.
WordPress is ridiculously easy to setup. It really does not matter whether or not you are an expert at phpMyAdmin or SQL. This is your opportunity to learn how to install WordPress locally, while giving you a second benefit of having a copy of WordPress that you can break (and thus learn) without any dire consequences.

Let us begin the process. Open up your browser of choice and visit wordpress.org. Download the latest version of wordpress to your desktop.

Once it has finished downloading, we are going to unzip the contents. You will notice that the unzipped folder is labeled “Wordpress”. Let’s rename the folder to “testsite”, or anything of your choosing (make sure to leave out any spaces).

The next step in the processes to create a new MySQL database. In order to do this we need to utilize phpMyAdmin. Switch over to MAMP and open the start page.

Click on the phpMyAdmin tab so we can create a new database.

Under create a new database type “testsite” or enter the name you chose to name your downloaded WordPress folder. Make sure it is a collation database utilizing utf8. Click create to finish setting up the database.

The next step, setting up privileges to the database, only has to be done once. The user you are about to add will have privileges over all the databases you create. Click on the privileges tab at the top and then click add new user.

Enter your user name under Login Information. For this example, I am going use “jimmy.page” as the username. Feel free to enter your name anyway you like. Next, we are going to declare the host as “localhost”. The last thing that needs to be done on this page is to enter a password (make sure to remember it for later). For this example I am going to use “password” as the password. Click “Go” at the bottom of the page.

You will see the create new message dialogue at the top of the screen. Now all we have to do is set the privileges for our newly created user.

As the administrator you will want full privileges. Check all global privileges and hit go. You have successfully created a database and a user with access to that database.

In the last tutorial, Setting Up a Local Server for Mac OSX, we changed the default document location to the sites folder within your user profile. If you are using a different or the default location used in MAMP, you can progress by remembering to make everything relative to that specific location.

Let’s go back to our downloaded and unarchived WordPress folder and change the name to “testsite”.

The next step in the process is to place that folder in your Sites folder within your user profile.

Once we have the files in place, we need to make some little changes to the wp-config-sample.php file that is the default in WordPress. Navigate to the “testsite” folder and open it. We are looking for the “wp-config-sample.php” file. The first thing we need to do is rename it “wp-config.php”, so just delete the “-sample” from the filename.

Now, let’s open “wp-config.php” and change the MySQL settings to match the MySQL database we setup earlier. I am opening it with Adobe Dreamweaver, but you can open it with any other web software or TextEdit.

Replace the default information with the database name, username and password that was used to create the MySQL database and user in previous steps. Save the file once you have made the changes.
The last step is to open your browser of choice and type in “http://localhost/testsite” (make sure you have MAMP running) and fill in the information for your newly setup WordPress site. If you see an error page, make sure the information your typed in “wp-config.php” is correct.
In the future, if you create a new WordPress site locally, you will only need to create a new database because the user we setup has global privileges.
Leave a Response