How to create a database

A lot of web applications, scripts and Content Management System use databases. Also WordPress uses a MySQL database. If you want to start a blog you have to create first a database.  If you use Hostgator, you don´t have to do this before installing WordPress as it will be done automatically. Just keep reading if you are not using this server or if you want to add an additional database. If not, return to our how to start a blog tutorial.

Creating a database for WordPress is very easy and in this tutorial we will explain to you the steps. You will be able to create a database in two minutes. Once you went through this tutorial you can start installing WordPress. If you use Hostgator as your server you have to access your cpannel using your username and password. Once you´re in you have to scroll down to the center and search the “MySQL Databases” icon at the “Databases” category.  Clicking on the icon will take you to the database configuration site where you can create the database (db), username and link both.

sql menu

Create the MySQL datablase

At the beginning you will see the message “There are no databases associated with your account”. For creating one just fill the “Create New Database” field with a name. This name will be the name of your database. The structure of your database name will be your Hostgator username followed by an underscore ( _ ) and the name you write in the field.

create a mysql database

After pressing on “Create Database” you will get a message saying that your database has been created.

Create a new user for the database

Now return to the configuration site for creating a username. Go to MySQL Users and create a new one. You just have to write a name and a password. Don´t use your Hostgator or e-mail name or password. For security reasons you should use a new one. Click on “create user”.

sql database user

Once again you will get a message saying that your user has been created. Return back again.

Link a database with a user

The last thing you have to do is linking your new database with your new username. This will be done at the “Add user to database” menu.  At the beginning you just will have one username and one database. Link them and press on “Add”.

user db

At the next window you only have to press on the “All Privileges” checkbox and on “make changes”.

database privilegesCongratulations, you just finished your mySQL database configuration. Remember the name of your database, your username and your password.
Press here for learning how to install WordPress at our tutorial How to start a blog.