Kat

How to Create a MySQL Database

Create a MySQL DatabaseToday we’ll review how to create a MySQL database. But first let’s look into what a MySQL database is, and why it’s needed.

MySQL is a relational database that’s used to store various types of information on a website. SQL (which stands for Structured Query Language) is the language used to interact with the database. It retrieves information from the database by posing a question, called a ‘query’.

It’s called ‘relational’ because the information stored in the tables of the database is related to each other. For example, information about customers you may have is related to information about the products they purchase from you. Customer data may be stored in one table, and product data in another. It’s a simple example, but effectively illustrates the purpose of a MySQL database.

When installing WordPress, a MySQL database is created – either on the fly by an auto installer such as Fantastico, or manually by you. It’s better to manually create a MySQL database because doing so will enable you to customize elements that can provide for greater security of your database (see Security Risks Using Auto Installers).

With that bit of background, let’s get on with the easy stuff.

How To Create a MySQL Database

1. Log into your cPanel account.

2. Scroll down to the Databases section and click on MySQL Database Wizard.

3. Choose a database name and enter it in Step 1. Create a Database. Then click the Next Step button.

4. Choose a database username and password and enter them in Step 2. Create Database Users. Use the Password Generator if desired. Then click the Create User button.

5. On the Step 3: Add User to the Database page, select the All Privileges checkbox. Click the Next Step button.

6. On the Step 4. Complete the task page, make note of the full database name and user name.

7. Record the values you chose for your database name, username, and password. Also note the hostname, which in most cases is localhost. If uncertain, contact your web host administrator.

Note that in order to make them unique, both the database name and username you created were prefaced with your cPanel username and underscore. Your full database and user names include this prefix. You’ll need all of this information when you perform and manual installation of WordPress.

Best Practices When You Create a MySQL Database

Bearing in mind that there are some unscrupulous people who may attempt to hack into your blog, it’s important to ‘harden up’ your MySQL database by following a few best practices.

First, while it’s helpful to choose a database name that accurately represents its contents, don’t use something that’s easily predictable, such as ‘wordpress’ or ‘wrdp1′ (the latter is commonly used by Fantastico).

Second, choose a username that is notably different from your database name. Don’t just append the word ‘user’ to your database name.

Third, use a strong password. The password generator incorporated into the wizard will give you a 12-character alphanumeric text string. If you choose your own password, make it at least 8 characters long (more is better), and use a combination of upper and lower case letters, numbers, and character symbols.

If you follow these guidelines when you create a MySQL database, you will have gone a long way toward securing your database.

As you’ve seen, it’s really quite easy to create a MySQL database. The tricky part (and really, not so tricky at that) is to follow the few guidelines outlined above to make sure that your new database is safe from hackers.

 

 

 

Leave a Reply