A database is a structured, organized set of data. In computing terminology a database refers to a software used to store and organize data. Think of it as a file cabinet where you store data in different sections called tables. When you need a particular file you look into that particular section (table) and get the file (data) you need.
WordPress uses MySQL as its database management system. MySQL is a software used to create databases, store and get data when requested. MySQL is also an open source software, just like WordPress and works best with other popular open source software, such as Apache web server, PHP, and Linux operating system.
To install WordPress you need a MySQL database. All WordPress hosting providers offer MySQL included in their hosting packages. During the installation (See: Complete WordPress Installation Tutorial), you provide WordPress your database information, and then WordPress takes care of rest of the things.
What is Database Host
Database host is the computer hosting your database on a MySQL server. Most of the time it is
localhost and entering localhost in the host field would connect WordPress to your database. However, some web hosting providers may use different host names to manage MySQL servers. You will find your host name in the MySQL or Database sections of your hosting control panel. Ask your hosting provider if you cannot find the host name.
What is Database Table
Databases have tables which are like sections or cabinets in your database system. Each table has columns and information is stored as rows. Each row has a field for each column in the table.
Example: an office database may have a table called
employee_records. This table may have following columns:
WordPress will automatically create tables inside your database. At the time of writing this, a default installation of WordPress would create the following tables:
Each of these tables would have different columns where data is stored. For example,
wp_users table in WordPress has these columns:
What is SQL Query
SQL is abbreviation for Structured Query Language, it is a special programming language used to manage databases. An instruction issued by SQL to the database server to retrieve data is called a query. WordPress uses MySQL queries to get data and use it to generate web pages.
A typical MySQL query looks like this:
SELECT * FROM wp_posts WHERE ID = 23;
SQL is not just limited to retrieve data from the tables. It can also update, insert and delete data from tables and even create new tables. This how WordPress stores and edits all your website data by storing and retrieving it from the database using SQL queries.
How to Manage WordPress Database
It is important to learn how you can do certain tasks on your WordPress database. This can help you troubleshoot some common WordPress issues, help you recover your website, and make your website more secure in general. For example, you would want to learn how to create regular backups.
WordPress databases can be managed using phpMyAdmin, which is an open source web application with a nice easy graphical user interface to manage MySQL databases. There are also many WordPress plugins available which can help you create WordPress database backups.