Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How many tables does the MySQL authorization system have?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how many tables are there in the MySQL authorization system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

One of the features of the MySQL server is that it provides great flexibility in controlling the behavior of each user. For example, we can restrict user access to the entire database, restrict user access to specific tables in the database, or prohibit access to specific columns in a particular table. This shows the flexibility of the MySQL server in terms of user authorization. This article will give you a detailed description of how the MySQL server handles the granting / revocation of user rights, especially the authorization tables tables_priv and columns_priv of MySQL.

The MySQL authorization system is usually implemented through five tables in the MySQL database: user, db, host, tables_priv, and columns_priv. These tables are used for different purposes, but they all have the same ability to verify that what the user is going to do is allowed. The fields of each table can be divided into two categories, one is the scope field and the other is the permission field. The scope field is used to identify the host, user, or database, while the permission field is used to determine which actions are allowed for a given host, user, or database. Let's give a brief introduction to the functions of these tables:

The MySQL authorization system has several tables

User table-this table determines whether users are allowed to connect to the server. If a connection is allowed, the permissions field is the global permission of the user.

Db table-used to determine which users can access which databases from which hosts. The permissions contained in the db table apply to the database identified by this table.

Host table-this table is used when you want to extend an entry within the scope of the db table. For example, if a db allows access through multiple hosts, the superuser can have the db table list host empty and then populate the host table with the necessary hostname.

Tables_ private table-this table is similar to the db table, except that it is used for tables rather than databases. This table also contains an additional field type, including the timestamp and grantor fields, which are used to store the timestamp and the authorized party. We will explain this table further later in this article.

Columns_priv-- this table works almost the same as the db and tables_ private tables, except that it provides permissions for specific columns of some tables. This table also has an extra field type, that is, other fields, including a timestamp column to hold the timestamp.

This is the end of the content of "how many tables are there in the MySQL authorization system". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report