grant

Mysql 基本命令

你离开我真会死。 提交于 2019-11-29 20:48:40
一. 创建用户 命令: CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明: username:你将创建的用户名 host:指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost,如果想让该用户可以 从任意远程主机登陆 ,可以使用通配符 % password:该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登陆服务器 例子: CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456'; CREATE USER 'pig'@'192.168.1.101_' IDENDIFIED BY '123456'; CREATE USER 'pig'@'%' IDENTIFIED BY '123456'; CREATE USER 'pig'@'%' IDENTIFIED BY ''; CREATE USER 'pig'@'%'; 二. 授权: 命令: GRANT privileges ON databasename.tablename TO 'username'@'host' 说明: privileges:用户的操作权限,如 SELECT , INSERT , UPDATE 等,如果要授予所的权限则使用 ALL databasename:数据库名

postgresql 9.1 - access tables through functions

被刻印的时光 ゝ 提交于 2019-11-29 19:35:34
问题 I have 3 roles: superuser, poweruser and user. I have table "data" and functions data_select and data_insert. Now I would like to define, that only superuser can access table "data". Poweruser and user can not access table "data" directly, but only through the functions. User can run only function data_select, poweruser can run both data_select and data_insert. So then I can create users alice, bob, ... and inherits them privileges of user or poweuser. Is this actually achievable? I am

How can I list ALL grants a user received?

六月ゝ 毕业季﹏ 提交于 2019-11-29 18:43:36
I need to see all grants on an Oracle DB. I used the TOAD feature to compare schemas but it does not shows temptable grants etc. so there's my question: How can I list all grants on a Oracle DB? If you want more than just direct table grants (e.g., grants via roles, system privileges such as select any table, etc.), here are some additional queries: System privileges for a user: SELECT PRIVILEGE FROM sys.dba_sys_privs WHERE grantee = <theUser> UNION SELECT PRIVILEGE FROM dba_role_privs rp JOIN role_sys_privs rsp ON (rp.granted_role = rsp.role) WHERE rp.grantee = <theUser> ORDER BY 1; Direct

MySQL权限系统

∥☆過路亽.° 提交于 2019-11-29 14:48:31
MySQL权限级别   全局性的管理权限,作用整个MySQL实例级别   数据库级别的权限,作用于某个指定的数据库上或所有数据库上   数据库对象级别权限,作用于指定的数据库对象上(表,视图等)或所有的数据库对象上   权限存储在mysql库的user,db,tables_priv,columns_priv,and procs_priv这几个系统表 查看所有用户 mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 4 rows in set (0.01 sec) 查看mysql实例默认root用户权限 ysql> show grants for root@'localhost'\G *************************** 1. row ***************************

Grant on multiple databases. MySQL

泄露秘密 提交于 2019-11-29 14:42:08
问题 How to grant on multiple databases? MySQL. Something like GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON 'databasesprefix%'.* TO testuser@localhost IDENTIFIED BY 'testpasswd'; 回答1: your example should work. from the (5.5) manual: The “_” and “%” wildcards are allowed when specifying database names in GRANT statements that grant privileges at the global or database levels. with % matching any number (even zero) of characters, and _ matching exactly one character. if you want a _ in your database

“IDENTIFIED BY 'password'” in MySQL

人走茶凉 提交于 2019-11-29 11:03:49
问题 I often see in many MySQL tutorials that people use command IDENTIFIED BY 'password' both during user creation and granting him privileges. For example: CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password'; I tried using GRANT without IDENTIFIED BY and it works. Can somebody explain me why it is used twice? Could there be other password for specific privileges? 回答1: GRANT is meant for adding

Linux(Contos7)下使用SSH远程安装MySQL 8.0.17 完整笔记

北战南征 提交于 2019-11-29 09:41:50
1. 使用putty 配置远程服务器连接,登录服务器。 由于没有指定下载包 使用 yum install mysql-server 提示 未指定包,如: 2. 因为甲骨文的收购了Mysql并且对Mysql进行了闭源开发,所以以前的yum下载命令无法获取到下载包,我们使用rpm方式来安装,这时我们就需要从官网去下载Mysql的社区版安装包。 地址:https://dev.mysql.com/downloads/repo/yum/ 使用命令: wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm yum install mysql-community-server 3. 安装完毕,启动Mysql, 并查看状态。 service mysqld start service mysqld status 看到绿色的active(running)就代表服务启动成功了。 4. 配置Mysql 登录MySQL ,系统初始时使用的默认密码,如果没记住,则会登录失败 mysql -uroot -p 提示错误, 使用 命令查看初始密码:grep password cat /var/log/mysqld.log |

Granting Rights on Stored Procedure to another user of Oracle

泄露秘密 提交于 2019-11-29 08:47:35
问题 I am a student of Undergraduate studies , and I am facing little problem in granting rights of ownership to a user A to a stored procedure being owned by user B in database Oracle 10g mode =xe. Please help me in writing sql commands for granting rights of ownership on stored procedure xyz to another user A. 回答1: I'm not sure that I understand what you mean by "rights of ownership". If User B owns a stored procedure, User B can grant User A permission to run the stored procedure GRANT EXECUTE

mysql创建用户和权限管理

£可爱£侵袭症+ 提交于 2019-11-29 06:25:55
一 权限管理      我们知道我们的最高权限管理者是root用户,它拥有着最高的权限操作。包括select、update、delete、update、grant等操作。那么一般情况在公司之后DBA工程师会创建一个用户和密码,让你去连接数据库的操作,并给当前的用户设置某个操作的权限(或者所有权限)。那么这时就需要我们来简单了解一下: 如何创建用户和密码 给当前的用户授权 移除当前用户的权限   如果你想创建一个新的用户,则需要以下操作:    1.进入到mysql数据库下 mysql> use mysql Database changed    2.对新用户增删改 1.创建用户: # 指定ip:192.118.1.1的chao用户登录 create user 'chao'@'192.118.1.1' identified by '123'; # 指定ip:192.118.1.开头的chao用户登录 create user 'chao'@'192.118.1.%' identified by '123'; # 指定任何ip的chao用户登录 create user 'chao'@'%' identified by '123'; 2.删除用户 drop user '用户名'@'IP地址'; 3.修改用户 rename user '用户名'@'IP地址' to '新用户名'@'IP地址'

数据库安全性控制

拟墨画扇 提交于 2019-11-29 05:02:42
4.2数据库安全性控制 4.2.1 用户身份鉴别 静态口令 动态口令 一次一秘 生物特征 指纹虹膜,掌纹 智能卡鉴别 4.2.2 存取控制 存取控制,授权的访问数据,没得访问不了 存取控制子系统: 定义用户权限,合法权限检查 定义用户权限 将用户权限登记在数据字典中 合法权限检查 用户发出请求,数据管理系统查找数据字典,进行权限检查 自主存取控制 (DAC) 强制存取控制(MAC) DAC 用户能将权限授权给其他用户 MAC 控制严格,只有合法许可证用户可以存取 4.2.3自主存取控制方法 *** 通过sql的grant revoke 实现 *** 用户权限要素 -. 数据库对象 -.操作类型 非关系型:存取控制对象数据本身 关系型:还包括数据库模式:数据库表,基本表,视图,索引 4.2.4授权与收回 grant revoke grant grant语句的格式:grant <权限> [,<权限>] on <对象类型> <对象名>[] to <用户> [] [with grant option] -. 查询用户权限授给用户U1 grant select on table stuent to u1; -. 对student course 表所有操作权限给用户u1,u2 grant all privileges on table student table,course to u1,u2