Introduction to MySQL database and its ODBC Interface (2) (reproduced)

Source: Internet
Author: User
Tags empty interface odbc mysql valid mysql database
mysql|odbc| Data | Database sender: Engineer (Jean ~ still have to go, sigh ...), letter area: Linux
Title: Introduction to MySQL Database and its ODBC Interface (2) (reprint)
Letter station: BBS Water Wood Tsinghua Station (Mon Aug 9 18:03:20 1999)

The following text is reproduced from the Database discussion area.
"The original was published by engineer."
Five. MySQL's Rights management

MySQL's authority management is very complex, it can be said that this is its pride, security management is conducive to the stability of the system?
Basic principle: [user] from [host] to [db] (of localhost)

There are four partitions in the system database MySQL: Func,user,db,host. The latter three are related to rights management.
Their structure is as follows:

Database:mysql Table:user Rows:3
+---------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+----------+------+-----+---------+-------+
| Host |      char (60) | |         PRI |       | |
| User |      char (16) | |         PRI |       | |
| password |      char (16) |     |         |       | |
| ... _priv |      char (1) |     | |       N | |
+---------------+----------+------+-----+---------+-------+

Database:mysql table:db Rows:3
+-------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+-------+
| Host |      char (60) | |         PRI |       | |
| Db |      char (32) | |         PRI |       | |
| User |      char (16) | |         PRI |       | |
| ... _priv |      char (1) |     | |       N | |
+-------------+----------+------+-----+---------+-------+

Database:mysql Table:host rows:0
+-------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+-------+
| Host |      char (60) | |         PRI |       | |
| Db |      char (32) | |         PRI |       | |
| ... _priv |      char (1) |     | |       N | |
+-------------+----------+------+-----+---------+-------+

1. The permissions in the user table are valid for any database that is not listed in the DB table.

You can set certain Superuser permissions only in the user table, but not in the DB table.
2.host is only used to maintain a valid server, the default is an empty table, that is, the LAN
Of all the machines.
3. Use mysql-u root mysql command to modify permissions.
4. The principles to be followed when matching permissions are:
A. Table order: Host-> db-> user;
B. Host and DB domains can have wildcard characters% and _, representing all and single characters;
C. In the same table, is also the order of the Host->db->user field, no wildcard character is excellent
to have wildcard characters;
D. The user domain is empty ('), indicating that all other users are matched;
E. Host can be machine name, LOCALHOST,IP, or wildcard character (such as 192.10.10.%),
But it is not allowed to begin with numbers and dots (e.g. 123.321.1.edu.cn);
F. The final "or" of the mandate in each table;
5. After the modification, perform mysqladmin-u root reload update.

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.