grant

GRANT with database name wildcard in MySQL?

偶尔善良 提交于 2019-11-27 05:29:55
问题 I want to create a user 'projectA' that has the same permissions to every database named 'projectA_%' I know its possible but MySQL doesn't like my syntax: grant all on 'projectA\_%'.* to 'projectA'@'%'; Reference: http://dev.mysql.com/doc/refman/5.1/en/grant.html 回答1: If I use back-tics instead of single quotes in the syntax, it appears to work just fine: grant all on `projectA\_%`.* to `projectA`@`%`; 回答2: GRANT ALL PRIVILEGES ON `projectA\_%`.* TO 'projectA'@'%' IDENTIFIED BY 'your_passwd'

创建表空间及用户的SQL

无人久伴 提交于 2019-11-27 04:09:54
--创建表SOFA空间: CREATE SMALLFILE TABLESPACE "SOFA" DATAFILE 'G:\oracle\product\10.2.0\ORADATA\ORCL\SOFA' SIZE 100M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; --创建SOFA用户: CREATE USER "SOFA" PROFILE "DEFAULT" IDENTIFIED BY "SOFA" DEFAULT TABLESPACE "SOFA" ACCOUNT UNLOCK; GRANT COMMENT ANY TABLE TO "SOFA"; GRANT SYSDBA TO "SOFA"; GRANT "CONNECT" TO "SOFA"; GRANT "DBA" TO "SOFA"; GRANT "RESOURCE" TO "SOFA";    PS:以下SQL在表空间不足的情况下使用 --查看SOFA表空间数据文件所在路径 select file_name from dba_data_files where tablespace_name = 'SOFA' --修改SOFA表空间大小,增加数据文件 ALTER TABLESPACE SOFA ADD DATAFILE 'G:

ubuntu 18.04 安装mysql

左心房为你撑大大i 提交于 2019-11-27 03:51:16
查看有没有安装MySQL: dpkg -l | grep mysql 安装MySQL: apt install mysql-server apt install mysql-client apt install libmysqlclient-dev 安装完成之后可以使用如下命令来检查是否安装成功: netstat -tap | grep mysql mysql_secure_installation 该脚本将通过一系列的提示帮你完成MySQL安装安全选项的变更。第一个提示将询问你是否愿意安装密码检测插件,该插件用来测试你设置的MySQL密码的强壮性。无论你如何选择,下一个提示是让你设置MySQL root用户的密码。回车,然后需要确认你输入的密码。 secure enough. Would you like to setup VALIDATE PASSWORD plugin? # 要安装验证密码插件吗? Press y|Y for Yes, any other key for No: N # 这里我选择N Please set the password for root here. New password: # 输入要为root管理员设置的数据库密码 Re-enter new password: # 再次输入密码 By default, a MySQL installation

Grant a user permission to only view a mysql view

不打扰是莪最后的温柔 提交于 2019-11-27 02:04:36
问题 The below question pertains to MySQL 5.1.44 Let's say I have a table with records inserted by different users of my application. How can I give a specific user access to only see his/her records in that table? I've thought about creating a VIEW with his/her records, but I don't know how to create a mysql user that can only see that VIEW . So, is it possible to create a mysql-user that only has access to a single VIEW ? can this user also be made so they read-only access to that VIEW ? Thanks!

SQL Server : can you limit access to only one table

旧街凉风 提交于 2019-11-27 01:51:28
问题 I think the answer is no but I'm looking to give someone access to a SQL Server database but I only really want them to have access to one table. It's easy enough to limit someone to only access one database but have no idea if I can limit to a single table. My thoughts were to create another database with a synonym to the other table and then limit the access to that database but I wondered if someone could think of a better way. I'm also not convinced that it will work as I think there will

mysql权限

无人久伴 提交于 2019-11-27 01:14:43
允许myuser使用mypassword从任何主机连接到mysql服务器 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 允许用户myuser从ip为10.22.4.45的主机连接到mysql服务器,并使用mypassword作为密码 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'10.22.4.45' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUASH PRIVILEGES; 允许myuser从ip为10.22.4.45的主机连接到mysql服务器的test数据库,并使用mypassword作为密码; GRANT ALL PRIVILEGES ON test.* TO 'myuser'@'10.22.4.45' IDENTIFIED BY 'mysqlpassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 转载于:https://www.cnblogs.com/nzbbody/p/4320567.html 来源: https://blog.csdn.net/weixin_30876945

Grant privileges on several tables with specific prefix

偶尔善良 提交于 2019-11-27 01:08:34
问题 I'm using the table prefix method for having several clients use the same database. The number of tables created per client will be ~55. Instead of doing all of the granting by manually listing out the tables, can I do something like the following? GRANT SELECT,INSERT,UPDATE,DELETE ON database.prefix_* TO 'username'@'localhost' IDENTIFIED BY 'password'; 回答1: Advance Note: This is not my answer. I found it at http://lists.mysql.com/mysql/202610 and have copied and pasted for simplicity credit

Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)

白昼怎懂夜的黑 提交于 2019-11-27 00:05:15
问题 I have a MySQL user called dump with the following perms: GRANT USAGE ON *.* TO 'dump'@'%' IDENTIFIED BY ... GRANT SELECT, LOCK TABLES ON `mysql`.* TO 'dump'@'%' GRANT SELECT, LOCK TABLES ON `myschema`.* TO 'dump'@'%' I want to dump all data (included triggers and procedures) using the dump user. I call mysqldump in the following way: mysqldump -u dump -p --routines --triggers --quote-names --opt \ --add-drop-database --databases myschema > myschema.sql Everything is OK with the dumped file

PostgreSQL 8.4 grant DML privileges on all tables to a role

随声附和 提交于 2019-11-26 23:29:06
问题 How do I go about granting DML (SELECT,INSERT,UPDATE,DELETE) on all tables in a schema in PostgreSQL 8.4? I'd also like this grant to persist for new table creation in the future as well. I've seen solutions for 9.0 but I'm stuck with 8.4 as it ships with Debian stable. I have tried the following as a baseline but it doesn't work, resulting in the inevitable "access to relation X denied": GRANT ALL PRIVILEGES ON DATABASE testdb TO testuser; I've dredged through the documentation and I can't

MySQL之权限管理

放肆的年华 提交于 2019-11-26 20:33:16
一、MySQL权限简介 关于mysql的权限简单的理解就是mysql允许你做你全力以内的事情,不可以越界。比如只允许你执行select操作,那么你就不能执行update操作。只允许你从某台机器上连接mysql,那么你就不能从除那台机器以外的其他机器连接mysql。 那么Mysql的权限是如何实现的呢?这就要说到mysql的两阶段验证,下面详细介绍:第一阶段:服务器首先会检查你是否允许连接。因为创建用户的时候会加上主机限制,可以限制成本地、某个IP、某个IP段、以及任何地方等,只允许你从配置的指定地方登陆。第二阶段:如果你能连接,Mysql会检查你发出的每个请求,看你是否有足够的权限实施它。比如你要更新某个表、或者查询某个表,Mysql会查看你对哪个表或者某个列是否有权限。再比如,你要运行某个存储过程,Mysql会检查你对存储过程是否有执行权限等。 MYSQL到底都有哪些权限呢?从官网复制一个表来看看: 权限 权限级别 权限说明 CREATE 数据库、表或索引 创建数据库、表或索引权限 DROP 数据库或表 删除数据库或表权限 GRANT OPTION 数据库、表或保存的程序 赋予权限选项 REFERENCES 数据库或表 ALTER 表 更改表,比如添加字段、索引等 DELETE 表 删除数据权限 INDEX 表 索引权限 INSERT 表 插入权限 SELECT 表 查询权限