grant

Oracle - How to grant to a user the rights to another user's objects

雨燕双飞 提交于 2019-12-04 04:10:37
I need to give to user TARGETUSER the rights to select/insert/update to all tables of user SOURCEUSER (I can figure this all out from here ) and the ability to run all their stored procedures. Basically, I wouldn't complain if I can give TARGETUSER the ability for all non-ddl activity with SOURCE_USER's objects. How do I do this? You can write a simple procedure to do this: BEGIN FOR Rec IN (SELECT object_name, object_type FROM all_objects WHERE owner='SOURCEUSER' AND object_type IN ('TABLE','VIEW','PROCEDURE','FUNCTION','PACKAGE')) LOOP IF Rec.object_type IN ('TABLE','VIEW') THEN EXECUTE

Can wildcards be used on tablenames for a GRANT in MySQL

此生再无相见时 提交于 2019-12-04 03:52:52
问题 Is it possible in MySQL to do a GRANT to a user on a set of tables within a database, e.g. to allow CREATE AND DROP ing of some table names but not others? Neither of these seem to work: GRANT SELECT ON `testdb`.`%_testing` TO 'wildcardtest'@'localhost'; GRANT SELECT ON `testdb`.`testing%` TO 'wildcardtest'@'localhost'; and the MySQL manual doesn't seem to give an answer either way. 回答1: The only wildcard that works in the GRANT statement is * GRANT SELECT ON `testdb`.* TO 'user'@'localhost';

Mysql: execute command denied to user ''@'localhost' for routine error

不问归期 提交于 2019-12-03 23:33:24
i got some problem during open my old website. My dataTable show: DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. After that, I tried to debug my script and found error in mysql: Error occuered during query execution: (<small>SELECT SQL_CALC_FOUND_ROWS ID,name,remark,avrusepmonth , CONCAT('<input type=''checkbox''id=''cb' , ID ,''' name=''check[]'' value=''',ID,''' >','<label class=''lbcb'' for=''cb', ID,'''><=update=</label>') as checkb ,monthavrage(ID,12) as latestavr , moq, leadtime FROM test_media WHERE nowuse=1 and monthavrage(ID

mysql权限控制

天大地大妈咪最大 提交于 2019-12-03 19:52:38
1、创建新用户   通过root用户登录之后创建   >> grant all privileges on *.* to testuser @localhost identified by "123456" ;  //  创建新用户,用户名为testuser,密码为123456 ;   >> grant all privileges on *.* to testuser @localhost identified by "123456" ;  //  设置用户testuser,可以在本地访问mysql   >> grant all privileges on *.* to testuser @"%" identified by "123456" ;   //  设置用户testuser,可以在远程访问mysql   >> flush privileges ;  //  mysql 新设置用户或更改密码后需用flush privileges刷新MySQL的系统权限相关表,否则会出现拒绝访问,还有一种方法,就是重新启动mysql服务器,来使新设置生效      2、设置用户访问数据库权限   >> grant all privileges on test_db.* to testuser @localhost identified by "123456" ;  // 

Mysql:is not allowed to connect to this MySQL

假装没事ソ 提交于 2019-12-03 19:51:02
转自: http://blog.chinaunix.net/uid-27666459-id-4028596.html 如果你想连接你的mysql的时候发生这个错误: ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server 解决方法: 1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user; 2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器

mysql权限管理

可紊 提交于 2019-12-03 13:09:20
1. 创建用户 CREATE USER username IDENTIFIED BY 'password' ; 2. 用户授权 grant授权格式: grant 权限列表 on 库.表 to 'user_name'@'host name' identified by "密码"; user_name是用户名,host_name为主机名,即用户连接Mysql时所在主机的名字。 //授予用户增删改查权限 grant select,insert,update,delete on *.* to 'user'@'%'; //给予全部权限 grant all privileges on *.* to 'user'@'%' ; //限制john用户只有查询cms数据库的权限,可限制到表 grant select on cms.* to 'john'@'127.0.0.1'; 每次操作完要刷新授权 flush privileges; 3. 查看用户权限 show grants for '用户'@'ip'; # show grants for 'root'@'127.0.0.1'; 4. 回收权限 revoke回收权限格式: revoke 权限列表 on 库.表 from 用户名@'ip'; revoke select,insert,update,delete ON *.* from 'user'@'

Grant alter on only one column in table

两盒软妹~` 提交于 2019-12-03 10:45:57
I want to grant a user only to edit one column in my table. What command do I use here? I use the oracle 11g database. I alrdy know how I can grant only read or delete on the whole table but how do I do it for only one column or more? pls give an example. Vinayak Pahalwan For example, you want to grant update privilege on ename column only, then give the following statement (where xyz is the username) grant update (ename) on emp to xyz; Syntax: grant update(column-name) on table-name to user-name EDIT: (for granting select privilege) To grant select statement on emp table to XYZ and to make

SQL grant execute on multiple objects

感情迁移 提交于 2019-12-03 07:57:27
Hi all I want to add execute permissions to a user for multiple objects. But I can't seem to add wildcards into my code. GRANT EXECUTE ON OBJECT::dbo.CREATESERVERSESSIONS TO [domain\user]; this works but I have a lot of stored procedures that start with XU_ now I want grant execute on all stored procedures that start with XU_ GRANT EXECUTE ON OBJECT::dbo.XU_* TO [domain\user]; but that is not working. I hope someone knows a solution to this. Thanks in advance. You cannot use wildcards - you have to grant either to all objects (or all objects in a schema) - or then you have to list all objects

Grant all privileges to user on Oracle schema

不羁的心 提交于 2019-12-03 07:50:41
Is there a way to grant all privileges to a user on Oracle schema? I tried the following command but it only grants permission on specific tables in a schema. What I want is to give this user all permissions on a given schema. GRANT ALL ON MyTable TO MyUser; Wernfried Domscheit You can do it in a loop and grant by dynamic SQL: BEGIN FOR objects IN ( SELECT 'GRANT ALL ON "'||owner||'"."'||object_name||'" TO MyUser' grantSQL FROM all_objects WHERE owner = 'MY_SCHEMA' AND object_type NOT IN ( --Ungrantable objects. Your schema may have more. 'SYNONYM', 'INDEX', 'INDEX PARTITION', 'DATABASE LINK',

通过注册表强制解锁文件占用

ぐ巨炮叔叔 提交于 2019-12-03 04:18:57
将下面的文本保存为 xxx.reg 并运行一下,添加注册表项目。 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\takeownership] @="Take ownership" "HasLUAShield"="" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOT\*\shell\takeownership\command] @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F" "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F" [HKEY_CLASSES_ROOT\exefile\shell\takeownership] @="Take ownership" "HasLUAShield"="" "NoWorkingDirectory"="" [HKEY_CLASSES_ROOT\exefile\shell\takeownership\command] @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\"