In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Grant authorization (create and authorize users. Users created in this way have created databases, tables, etc.):
Grant permission type on library. Table / function / stored procedure to 'username' @ 'host' [identified by 'testpass']
Where the permission type all represents all permissions, and the all contains: create,drop,insert,update,delete,select, and so on.
Example 1. Grant all permissions of the students table of the mydb library to 'testuser'@'192.168.%.%', and set the secret to testpass:
Grant all on mydb.students to 'testuser'@'192.168.%.%' identified by' testpass'
Example 2. Grant all permissions of "all tables / functions / stored procedures of all libraries" to 'testuser'@'192.168.%.%' and set the secret to testpass:
Grant all on *. * to 'testuser'@'192.168.%.%' identified by' testpass'
Example 3. Select permissions for all tables in the mydb library are granted to 'readonly'@'%', is' readonly'@'%' only with query permissions.
Grant select on mydb.* TO 'readonly'@'%'
Second, the type of permission:
1. Administrative class permissions: create user,file,show databases,super
Reload,shutdown,processlist,replication slave
Replication client,lock tables
2. Library level and table level permissions: alter,create,create view,drop,execute
Index,grant,show view
3. Data manipulation (table level): select,insert,update,delete
4. Field level: select (col1,...), insert (col1,...), update (col1,...)
3. View the permissions of a user:
Show grants for 'username' @ 'host'
4. Revoke withdraws the authority:
Revoke permission type on library. Table / function / stored procedure from 'username' @ 'host'
For example, all privileges of the user 'testuser'@'localhost' will be revoked.
Revoke all on *. * from 'testuser'@'localhost'
5. Tables related to user authorization in the mysql library:
Db: permissions at the library level.
Tables_priv: table-level permissions.
Colomns_priv: permissions at the column level.
Procs_priv: permissions related to stored procedures and stored functions.
Proxies_priv: permissions related to the proxy user.
6. Flush:
1. Flush privileges: refresh authorization, which is generally used to authorize an account to take effect immediately.
2. Flush hosts: clear host, generally used because the account information is not clear. When the connection to the database has failed several times, then when the connection to the correct account information is rejected, you need to execute flush host.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.