How To Create a Database and Install WordPress

This tutorial isn’t just about installing WordPress. It will cover how to set up a database using cpanel, and optionally, how to unzip files directly on your web server.

WordPress has documentation on their site about installation too, but I’m going to share with you how I like to do it.

The Easy Way

Estimated Time: 15 minutes
Skill Level Required: Beginner
Requirements:

  • Access to a web server (FTP and cpanel)
  • An FTP client

Steps:

  1. Download WordPress. Go to wordpress.org/download and click Download WordPress. Save the zip file to somewhere on your computer. The desktop works well (you can delete it in a minute).
  2. Unzip it. Find the file on your computer, right-click it and click “extract here”. If you don’t have an option like that, you might need a file (un)archiver. I like WinRar, but 7-Zip is free. This will create a folder called “wordpress” on your desktop.
  3. Upload it. Open your FTP client (FileZilla is free if you need one), and connect to your web server. You will need a server address (your domain), a username, and password to do this. After you’ve connected, upload all the files inside the WordPress folder (don’t upload the folder itself unless you want WordPress to be located at yoursite.com/wordpress). You probably want to put these files inside the “www” or “public_html” folder on your web server. If there are a bunch of files in there already, they might conflict with WordPress; consider deleting them or moving them to a subfolder.
    Note:
    I’m not responsible if your web server explodes or anything else bad happens.
  4. Create a configuration file. Go to yoursite.com. You should be presented with a screen that looks something like this (from WordPress 2.7)
    wp-create-config-fileIgnore the warning and click the big round “Create a Configuration File” button. It should work for most setups (if it doesn’t, you’d better follow their instructions, not mine).
  5. Next. Ignore the pretty text on the next page, and click “Let’s go!”
    wp-lets-go
  6. Setup the database. Now it’s going to ask you for a bunch of info. If you don’t know what to put here, I can tell you how to set it up if your web host is using cpanel. Open yoursite.com/cpanel in a new tab/window. If you get a 404 or something like that, talk to someone else 🙂 If it asks you for your username and password, enter it. Depending on the version of cpanel, you should be presented with a bunch of icons. Find the one that says “MySQL Databases” and click it. We’re going to create a new database for WordPress so that we don’t accidentally muck anything else up. Near the top of the page there should an area to “create a new database”. Enter something clever like “wordpress” or “mysite” and create the database.
    cpanel-new-database
    Scroll down to where it says “add new user”. Choose a username and password, and create a user. You might as well make your password a bunch of random upper and lowercase letters, numbers, and symbols. You should only need to enter this password once after it’s created. Now, scroll past “add new user” to “add user to database”. Choose the username and database you just created, then click “add”. If the username and database have another username before it, make note of this; you will need to enter these into the WordPress installation form.
    cpanel-add-user
  7. Fill in the WordPress form. Great, your database is set up. Now you can fill in that old form. Enter the database name, user name and password you just chose (with the prefixes if it added them). You shouldn’t need to change the database host or table prefix. Click “Submit”.
    wp-database-connection-details
  8. You’re done. You can listen to WordPress now 🙂 It will guide you through the rest.

The Faster Way

WordPress 2.7 is 1.76 MB compressed, or 5.38 MB uncompressed with 603 files. I find it considerably faster to upload just the zip file.

Estimated Time: 10 minutes
Skill Level Required: Novice
Requirements:

  • Access to a web server (FTP, cpanel, and shell)
  • An FTP client

Assumptions:

  • You can follow the steps above
  • You’re on a linux server, but have no knowledge of linux

Steps:

  1. Download WordPress.
  2. Don’t unzip it.
  3. Upload the zip file.
  4. Open up PuTTY or your favorite SSH program.
  5. Connect to your web server. If you’re on HostGator like me, you can find the IP Address on the left sidebar of your cpanel, under “Account Information”. The Port is 2222. You may need to ask Tech Support to enable Jailed SSH for you though.
  6. Enter your username and password. If you’re new to this, your password won’t appear as you type (no asterisks, nothing).
  7. Type the following commands. You can use tab to auto-complete folder and filenames. Adjust the file/folder names below as needed. Use the “ls” (list directory contents) and “pwd” (print working directory) commands to figure out where you are, if you get lost. Also, “man <command>” will give you more information about a particular command.
    cd public_html/<folder-where-you-uploaded-wordpress>
    unzip wordpress-2.7.zip
    mv wordpress/* .
    rm wordpress-2.7.zip
    rmdir wordpress
  8. Follow steps 4 onward, above.

That’s it for this tutorial, I hope you enjoyed it!

12 thoughts on “How To Create a Database and Install WordPress

  1. I lied, there’s an even faster way. Don’t download the zip file to your computer at all. Fire up PuTTy or your linux shell, SSH into your server, and `wget` the file directly to your server. Then go to step 7.

  2. Copyrighting is very important specially if you wrote original articles both online and offline.`~’

  3. @Josh: I have no idea what you’re referring to… I wrote all the articles on this site, are you proposing a put a more prominent copyright? Why is it so important? People would thieve it anyway and I probably wouldn’t take them to court unless that article was a particular money-maker.

  4. Copyright is really needed to protect your own works. in china, they are not even concered about it;’;

  5. Great Tutorial….Thank you so much!!!

  6. No idea. You’re going to have to be much more specific about what your problem is. Try stackoverflow.com or maybe superuser.com.

  7. Hey Mark, I am attempting to follow your step by step process and I am stuck on step 3 lol. I can’t get it to upload, but I keep getting this message:

    Status: Connection established, waiting for welcome message…
    Error: Connection timed out
    Error: Could not connect to server

    I have been looking other places in order to figure it out, but I can’t find an answer. If you could help me to proceed it would be greatly appreciated.

    Mal

  8. Your FTP client won’t connect? I’m not sure why that may be; you might have the wrong host address, something may be blocking you, or you may have the wrong credentials. Contact your server admin or web host provider and ask for the proper information to connect.

  9. i want to host PHP site with mysql site .but dnt know how to create database on web server.please guide me

Leave a Reply

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