Blog

What is a WordPress database and how do you optimize a database?

Afbeelding What is a WordPress database and how do you optimize a database?

WordPress has been praised for years as a platform on which beginners, without any technical knowledge of websites, can still set up beautiful sites. Many beginners therefore like to set up their website via WordPress. They then have a beautiful and well-functioning website without having to do much research.

Do you want to get more out of your WordPress website? Then a little more technical insight is useful. One of the parts where this insight comes in handy is with the database. In short, all information from your own website is stored here, so that the website can continue to function properly. What else you can do with this database and what it specifically entails, you can read here.

What exactly is a database?

All kinds of data are stored in a database. For example, the municipality’s database contains your first and last name, your address and some other personal data. The database of your former school or your current work also contains such data. A database is actually a large collection of all kinds of separate information units. This is also for a database on your WordPress website. Here all the necessary information from the website is stored that is necessary for the website to run properly. By adjusting this information, you can also customize the website.

How does a database work in WordPress?

As soon as you start creating and installing a new WordPress website, a database is automatically created. This is usually automatic, although you can also create one manually. You can even use an already existing database to build a new website.

This database is then stored on the hosting provider’s server. This is called a ‘database host’. As soon as someone wants to visit your website later, they enter the correct URL in their browser. This browser then sends a request to the server where your site is stored. The server responds to this request by returning all the necessary data from the database that is necessary to open the website. For this, a database needs its own software.

WordPress works together with MySQL, a management system that keeps track of all databases for WordPress. That is why a database at WordPress is sometimes also called a ‘MySQL database’. When you want to make an adjustment to your website, WordPress must send a ‘query’ to MySQL, which then adjusts this in the database.

To facilitate this process, you can also access your own database yourself. For this you often need a database tool. This is often much faster than via the WordPress dashboard and often gives you more options than the dashboard gives you.

Information in a database

The information that a database needs to function properly is divided and organized into different categories. So much information is needed for a smooth website that it is clearly included in so-called ‘database tables’. Compare this to a large filing cabinet, in which all important papers are divided into different folders and categories. That is why there is its own category in the database for each part of the website. In every new WordPress website, the following components are already in the database:

  • wp_commentmeta
  • wp_comments
  • wp_links
  • wp_options
  • wp_postmeta
  • wp_posts
  • wp_terms
  • wp_termmeta
  • wp_term_relationships
  • wp_term_taxonomy
  • wp__usermeta
  • wp_users

These names are listed in alphabetical order and give you an idea of which part is responsible for what. Each component is split into its own subcomponents and columns, which contain more detailed information for the main component. For example, ‘wp_comments’ includes ‘comment_ID’, ‘comment_author’, ‘comment_date’ and ‘comment_approved’.

In the case of ‘wp_comments’, you see that a database stores a lot of information and that only for the comments placed. If you want to delete comments, you have to be in this part of the database.

What is a MySQL database or query?

SQL stands for Structured Query Language, or a language that knows how to collect all the necessary information in a structured way. This code language is used to keep databases tidy and tidy. If a database needs to send data to a user who wants to access the website, this is called a query. As soon as someone wants to use your WordPress website, the database is used by WordPress to retrieve data and then load the web page.

With the SQL you can not only retrieve data and use it to start the website. You can also use it to update things on the website, enter new data or delete other data.

Installation of a WordPress database

Installing a WordPress database can be done in three different ways. We discuss the three most common options.

Installing database via Plesk

To be able to use this way, your hosting provider must support plesk’s service. You can then install WordPress manually. You can do this via the following steps:

  1. Create an account or log in to Plesk
  2. Choose ‘Websites and domains’
  3. In this menu you will then find ‘Custom website’ at the bottom right with the option ‘databases’. Click on ‘databases’
  4. Click on ‘Add new database’
  5. Rename the database and enter the correct information
  6. Click ‘OK’

That was it! You have now created a database via Plesk.

Database installation via cPanel

If your hosting provider supports cPanel, follow these steps. These are at least as simple as with Plesk.

  1. Create an account or log in to cPanel
  2. Choose ‘My SQL Database wizard’ in the ‘Database’ menu
  3. Follow ‘Step 1: Create a Database’ and name the database
  4. Follow ‘Step 2: Create Database Users’. Enter a name for the user(s) of the database and create a password for each account. Please note that this password must be strong enough. Then choose ‘Create User’
  5. Follow ‘Step 3: Add User to Database’ by clicking all the boxes and choosing ‘Next step’
  6. Follow “Step 4: Complete the task” by entering the hostname, username, database name, and password.

Database installation via phpMyAdmin

This way via phpMyAdmin requires a little more steps than the previous options, but can be useful if your hosting provider does not support either software. The following instructions are made for phpMyAdmin 4.4. So if you have an older or a newer version, take into account moved parts or other names.

  1. Don’t have a WordPress database yet? Then create it.
  2. Choose ‘Database’ and then ‘Create’
  3. Enter a name for your database in the ‘Create database’ section. Sometimes you can choose a suitable name yourself, but sometimes it is necessary to include your username in the name of the database.
  4. Choose a suitable language. In most cases, this is the ‘utf8_’ series. Then choose your own language. Is it not listed? Then choose ‘utf8_general_ci’
  5. Go back to the main menu by clicking on the logo at the top left
  6. Go to the ‘Users’ menu
  7. Select the right user or create a new one. How to create a new one, you can read below
    • Click on ‘Add user’
    • Choose a username and enter it in ‘User name’. Make sure you have selected ‘Use text field’ in the drop down menu
    • Choose a strong password in the ‘Password’ section. Again, select the ‘Use text field’. Then enter your password again.
    • Write down the chosen username and password
    • Leave ‘Global privileges’ everything on the current settings
    • Click on ‘Go’ and go back to the ‘Users’ menu
  8. Click here on ‘Edit privileges’ for the newly created user
  9. In this menu, choose the newly created database and add it to the newly created account via ‘Add privileges to the following database’. Then press ‘Go’
  10. Once the page has reloaded, click on ‘Check all’ and then again on ‘Go’
  11. Check if you see ‘server:hostname’ on the landing page above the ‘database’ menu

Database installation and optimization with plugins

Do you want to be able to deal with your MySQL database in a simple way? There are several plugins for WordPress for this. You have a huge choice, but we recommend the following plugins:

  • WP-DBManager
  • WP Optimize
  • Optimize Database After Deleting Revisions
  • UpdraftPlus
  • WordPress Database Reset
  • Contact Form DB
  • Participants Database

Summary

A database therefore contains all the necessary data and information that a website must send to users in order to give them a pleasant experience. This is divided on the basis of many different categories and subcategories, so that all parts can be clearly arranged. A database is necessary for a good functionality of your website, so that it is often automatically created. You can also do this manually, through three different ways: with Plesk, with cPanel, and phpMyAdmin. With plugins you can then simplify the actions within a database.

Also read our blog about the error when creating a database connection.

Do not hesitate and let our WordPress specialists advise you in case you need help! Please contact us via live chat, e-mail or call us on 030 20 72 488.

Was this article helpful?

Yes No

We'll assist you promptly and professionally!

Check here all benefits.

© WPmaintenance.com 2011 - 2024 | All rights reserved | WordPress Maintenance is part of Artitex