Joomla! 1.5 Cookbook
上QQ阅读APP看书,第一时间看更新

Setting up your database on a cPanel® host

This recipe will guide you through the steps necessary to set up a database on your cPanel® enabled host. cPanel® is by far one of the most popular control panels for web hosting, and as you get to know it you will see why. It is a very powerful and well-built application. We'll refer to it several times through various recipes.

We are using a http://www.rochenhost.com/ server for our screenshots.

Setting up your database is simple and easy.

Getting ready

To get started you were provided login details by your host for your cPanel® or 'hosting control' - most likely they will have their own name for it. However if you login and see something like the following generic cPanel screenshot - you are in the right place:

Getting ready

cPanel® is trademark by cPanel, Inc.

If you are in doubt, ask your hosting technical support.

Gather your host login information:

Login URL for cPanel®: ________________________________

Username for cPanel®: _______________________________

Password for cPanel®: ________________________________

Tip

If you cannot keep this book in a safe place, do not write usernames and passwords in it. These should be kept in a safe place.

Each database needs to have a unique name. You will need to provide a name for the database, the user name (for Joomla! itself), and a password. These should be different to your other username and passwords. It is recommended that you allow cPanel® to generate the password for you. This will ensure you have a very strong password.

How to do it...

  1. Login to your cPanel®
  2. Scroll down your screen till you see DATABASES
  3. Click the icon MySQL® Database Wizard - it should look this:
    How to do it...
  4. After you click this you will see the following screenshot - this is where you will start the database creation. In this example we have a "prefix" of watcher_ you will have a different prefix.
    How to do it...
  5. Fill in your database name which can be anything you want. It has a limitation of 16 characters. Try to choose something descriptive but not common. Write the database name here:

    Database name _________________________

  6. Click the Next Step button

    You should see something like:

    How to do it...

    This indicates our database watcher_cookbook was added successfully.

  7. Create a user for Joomla! in our database

    This step is necessary for Joomla! to talk to the database.

    How to do it...
  8. Create a username no longer than seven characters.

    Record the username here _______________________

    Now - for maximum security use the password generator. It will create a strong password for you. Here is an example of it in action.

    How to do it...
  9. Once it generates a password for you, click the I have copied this password in a safe place checkbox to use it.

    Record the password here for later use: ________________________

    Once you complete this step you should see this screen with your username inserted:

    How to do it...
  10. This completes the creation of the user. In our case we chose jadmin1 and our password of U&{u$.S1F2t_.
  11. Give the newly created user rights to use the database.

    The next screen you will see is the Privileges screen.

    The Privileges screen defines the rights this user will have to the database.

    How to do it...
  12. Check the ALL PRIVILEGES box.

    Now you will see that all the boxes are checked as follows. If they are not checked, Joomla! will fail to install properly.

    How to do it...
  13. Click the Next Step button. You will be presented with a screen similar to the following:
    How to do it...

    This completes the setup of your database. Now click Home in the upper left of the screen.

There's more...

We need to be sure the database is working. We do that by returning to the main cPanel® page and scrolling back down to the Database Section. Look for this icon and click it:

There's more...

Once you click that icon it will launch the administration tool for MySQL. You will see a screen like the one following this paragraph. Please note your information will be different, and the count in your database will be ZERO (0). This partial screenshot shows we have two databases in our example setup. You will only have one.

There's more...

Note the circled text in the preceding screenshot. The portion following the word MySQL will be your database server name.

Tip

Your server name may differ but will likely be localhost

Record the information you see located in your version of cPANEL®.

Database Server Name: ______________________

Tip

Database Server Name Tip

Most of the time, you can simply use localhost as your Database Server Name unless you see something else indicated in the green circled area.

This completes the set up of your database on cPanel®. You may skip over the GoDaddy.Com® instructions and continue with installing Joomla!

How it works...

This GUI that is embedded into the cPanel interface issues the necessary MySql commands to instruct the database server on setting up a database, adding a user, and giving that user proper permission to use the database.