A brief explanation of the knowledge of WordPress database and the use of commands

Source: Internet
Author: User
Tags md5 hash administrator password phpmyadmin wordpress database
WordPress starts with a simple blogging platform that has evolved over more than 10 years into a content management system that is used by many novices and experts, and even many high-end sites are built on this platform, which integrates and implements almost the largest number of features you can think of.

The biggest advantage is that WordPress installation, configuration, database creation, etc., do not require users with programming knowledge or basic theory. However, there are times when you will find that you have some basic knowledge of the database that will help you achieve the goal of optimizing your website.

WordPress Database

phpMyAdmin is the first choice for many DBAs database administrators to create databases, but in the context of SQL query statements, phpMyAdmin is not something that everyone likes to use.

You should have learned that WordPress is using a MySQL database, before you can use it, you need to perform a login operation first. You can log in by typing the following command at the command line:

mysql-u [user_name]-p-d [database_name]

Once you have logged in, you can view all the data tables and use the following command to view:

DESC [table_name]

Also note that the table prefix is the default WP, on behalf of WordPress, make sure that your prefix is correct, if you use a different prefix.

Let's take a look at the table of data sorted in alphabetical order.

1) wp_options

Configuration table, this table holds all the configuration information:

Title Caption

Tagline Label

Timezone Time Zone

All dashboards display a collection of databases to be stored in this particular table surface.

2) Wp_users

User table, as can be seen from the table name, this table stores all registered user information, including the following information:

Log-in ID User ID

Encrypted Password Hash computed password

e-mail ID user e-mail

Contact Numbers Telephone

Registration date and Time registration

Display Name

Status state

Activation Key Activation Code

3) Wp_usermeta

The user expands the information table to store some extended user information, such as the surname Last_Name, which is not stored in the Wp_users table.

The following fields are the places in this table where you need to be aware of the differences:

Meta_key

Meta_value

4) wp_posts

This table stores all the articles and pages of the site, including historical versions, and the navigation menus are stored in this table. Different article types use the Post_type field to differentiate.

5) Wp_postmeta

The article property sheet stores metadata for all articles, such as the tag data generated by some SEO plugins that are stored in the table.

6) Wp_terms

Articles, links, pages corresponding to the classification and tags stored in this table, often referred to as slug, his value will be reflected in the hyperlink, will eventually enhance the Google Spider search page effect, to achieve optimization purposes.

7) Wp_term_relationships

Attribute relationships table, which stores the mapping of label/category and article/page.

8) wp_term_taxonomy

This table stores the mapping relationships between taxonomy [taxonomy] and term.

Translator Note:

To illustrate:

You have created a new article, classified as fruit (fruit), the taxonomy "taxonomy" of this article is called category by default.

You have created a new article, classified as vegetables (vegetable), this article's Taxonomy "taxonomy" unchanged, still called category

At this point you want to build a series of articles about cars, do not want to confuse the original list of food articles,

Then you can create a new post_type, with a value of car, taxonomy as power,

The specific addition method can be used in official documents, search function Register_post_type usage,

Then add two articles, classified as battery and gas,

So in the table wp_term_taxonomy, there is a new mapping relationship record.

The SQL statement when querying for food is category= fruit

The SQL statement when querying the car is power=battery

9) wp_comments

Reviews of all pages are stored, including those that have not been approved, and other information that is filled in when commenting, and it is important to note that if you are using a third-party commenting system such as Disqus, the comments will not be stored in this form.

) Wp_commentmeta

As with other metadata tables, this table stores the extended metadata for comments.

One) wp_links

This table stores custom link information and needs to install a link management [links manager] plugin, although it is deprecated.

A few tips

Modify the Default user name

WordPress does not allow user names to be modified, but it can be modified by executing SQL statements.

Change Password

If you forget the administrator password, you can easily recover by modifying the database. Note that the password must be digest by the MD5 hash algorithm.

Delete all spam comments

Sometimes spam reviews can make you a headache, you could use plugins like Akismet to monitor and manage, but if you have a lot of spam reviews, you can clean them up by using SQL.

Check spam comment sources

All in all, this article hopes to let novice administrators on the database no longer confused, although there are countless plug-ins available today, but do not use blindly, first of all should consider the easiest way to solve your needs.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.