Skip to content

Website

How to create a database in WordPress?

This tutorial describes how to create a database using cPanel, a popular platform management utility offered by many web hosts. MySQL database is mostly confusing to many. The technique we will describe can be used by any web application that requires MySQL.

 

What is a database?

A database is a collection of organized data. For example, WordPress stores all of its pages, posts, categories, and user data in a database.

MySQL is a database management system ( Data Base Management System ). It is software that allows you to create, update, read and delete data in a database. A single MySQL installation can manage any number of standalone databases.

There are many alternatives, but MySQL has become popular for several reasons:

 

  • it is free and open source software. It is now owned by Oracle , but there are open MySQL compatible options such as MariaDB.
  • it has become synonymous with PHP, the programming language that is one of the most used on the web and powered by WordPress. Both PHP and MySQL appeared in the mid-1990s, when the development of the Internet was in its infancy.
  • adopts Structured Query Language, a fairly standard language for creating data and data structures.
  • it is fast, easy to install and has many other development tools.

 

How do applications access the database?

Applications like WordPress access their data through a database connection. In the case of MySQL, WordPress ‘s PHP code can only establish a connection when it knows:

 

  • the address where MySQL is installed
  • the name of the database to access
  • the user ID and password required to access that database

 

How is data stored?

MySQL and other SQL databases store data in relational tables.

For example, you might have a set of posts (articles). Each post will have unique data, such as title and body text. It will also have data used in other posts, such as category and author details. Instead of repeating the same data over and over again, we create separate tables:

 

  • author table containing ID, author name and other details
  • a table of categories containing the ID and name of the category
  • a table with a post containing the title of the article and the body of the text. It indicates the author and category by referencing the associated ID number.

 

SQL databases implement safeguards that guarantee data integrity. You cannot reference an author ID that does not exist or delete a category that is used by one or more articles.

These table definitions and rules make up the database schema. A set of SQL statements are executed during the WordPress installation when creating this schema. Only then are the tables ready for data storage.

 

How to create a database?

Hosts that use cPanel provide a web address (such as https://nazivsajta.com/cpanel) and a user ID and password for access. Keep these details safe.

If you’re looking for a provider that supports cPanel, try DreamWeb , our hosting provider of choice. All their plans support cPanel, and the control panel is organized for easy navigation and use.

Select the MySQL Database Wizard option and follow the next steps, which are quite intuitive.

You are then prompted to create and name your new database.

In the name, the site name_ prefix is ​​usually applied, and the corresponding database name is entered below. Enter an appropriate name such as blog or WordPress and click the Next Step option.

The next step is to create and define database users.

Note that the username will often have the same prefix as the database, in this case sitename_username .

cPanel will ensure that you enter a strong password, which must be complex, in order to protect access as much as possible and increase the security of the database. So make sure you keep your username and password in a safe place.

Next, you determine the user’s access privileges, that is, what all he will be able to change and update in the database. In these few steps, you have created a new MySQL database in the WordPress application with the help of cPanel.

 

Visit our News & Stories page, we have prepared numerous educational texts for you.

Made by Nebojša Radovanović – SEO Expert @Digitizer