数据库常用授权和授权回收参数配置-创新互联
标题索引
创新互联建站拥有网站维护技术和项目管理团队,建立的售前、实施和售后服务体系,为客户提供定制化的做网站、网站建设、网站维护、德阳电信服务器托管解决方案。为客户网站安全和日常运维提供整体管家式外包优质服务。我们的网站维护服务覆盖集团企业、上市公司、外企网站、商城网站定制开发、政府网站等各类型客户群体,为全球超过千家企业提供全方位网站维护、服务器维护解决方案。官方帮助
常用案例
官方帮助
在使用数据库时必不可少的即是查看help帮助,通过help帮助再次寻找常用命令及参数,如下为help grant信息:
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 | PROCEDURE priv_level: * | *.* | db_name.* | db_name.tbl_name | tbl_name | db_name.routine_name user_specification: user [ IDENTIFIED BY [PASSWORD] 'password' | IDENTIFIED WITH auth_plugin [AS 'auth_string'] ] Normally, a database administrator first uses CREATE USER to create an account, then GRANT to define its privileges and characteristics. For example: 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;常用配置
1.授权单位普通DBA或运维人员增删改查命令
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;2.授权某个用户某张表的某几列查询命令
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.撤销某用户的授权权限
MariaDB [(none)]> show grants for root@'172.18.0.%'; +--------------------------------------------------------------------------------------------------------------+ | Grants for root@172.18.0.% | +--------------------------------------------------------------------------------------------------------------+ | 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)另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
当前标题:数据库常用授权和授权回收参数配置-创新互联
当前URL:http://azwzsj.com/article/ggigp.html