In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Title index
Official help
Common cases
Official help
It is essential to check help help when using the database, and find common commands and parameters again through help help, as follows: help grant information:
MariaDB [(none)] > help grant;Name: 'GRANT'Description:Syntax:GRANT priv_type [(column_list)] [, priv_type [(column_list)]]. ON [object_type] priv_level TO user_specification [, user_specification]... [REQUIRE {NONE | ssl_option [[AND] ssl_option]...}] [WITH with_option...] GRANT PROXY ON user_specification TO user_specification [, user_specification]. [WITH GRANT OPTION] object_type: TABLE | FUNCTION | PROCEDUREpriv_level: * | *. * | db_name.* | db_name.tbl_name | tbl_name | db_name.routine_nameuser_specification: user [IDENTIFIED BY [PASSWORD] 'password' | IDENTIFIED WITH auth_plugin [AS' auth_string']] Normally, a database administrator first uses CREATE USER to create anaccount, then GRANT to define its privileges and characteristics. Forexample:CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY' mypass';GRANT ALL ON db1.* TO 'jeffrey'@'localhost';GRANT SELECT ON db2.invoice TO' jeffrey'@'localhost';GRANT USAGE ON *. * TO 'jeffrey'@'localhost' WITH MAX_QUERIES_PER_HOUR 90
Common configuration
1. Order for addition, deletion, alteration and search of ordinary DBA or operation and maintenance personnel of authorized units
MariaDB [(none)] > create table performance (id int, server_name varchar (20), Adress_City varchar (30)); MariaDB [(none)] > grant select,update,delete,insert on cluster.performance to root@'172.18.0.%' identified by 'jncsy';Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > flush privileges
two。 Authorize a user to query several columns of a table
MariaDB [(none)] > grant select (id,server_name) on cluster.performance to root@'172.18.0.%' identified by 'jncsy';Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > flush privileges
3. Revoke the authorization of a user
MariaDB [(none)] > show grants for root@'172.18.0.%' +-+ | Grants for root@172.18. 0.00% | + -- + | GRANT USAGE ON *. * TO 'root'@'172.18.0.%' IDENTIFIED BY PASSWORD' * 429B3FB345D35EC8C8B54230AD060C07E846494A' | GRANT SELECT INSERT, UPDATE DELETE ON `cluster`.`performance`TO 'root'@'172.18.0.%' | +- -+ 2 rows in set (0.00 sec) MariaDB [(none)] > revoke select on cluster.performance from root@'172.18.0.%' Query OK, 0 rows affected (0.00 sec)
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.