grant

MySQL/Amazon RDS error: “you do not have SUPER priviledges…”

痞子三分冷 提交于 2019-11-28 16:28:07
I'm attempting to copy my mysql database from an Amazon EC2 to an RDS: I successfuly did a mysqldump of my database into my root folder using this: root@ip-xx-xx-xx-xx:~# mysqldump my_database -u my_username -p > my_database.sql Then I tried to transfer this .sql file to my new RDS database: root@ip-xx-xx-xx-xx:~# mysql my_database -u my_username -p -h my_new_database.xxxxxxxxx.us-east-1.rds.amazonaws.com < my_database.sql Unfortunately, I get following error message: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function

mysql 用户的增删改与授权

大憨熊 提交于 2019-11-28 16:26:46
一、对新用户的增删改 1.添加新用户 允许本地 IP访问localhost的Mysql数据库: mysql> create user 'common'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.07 sec) 允许外网IP访问数据库editest,本命令包含上面的命令,是所有的IP都可以访问该数据库 mysql> create user 'common'@'%' identified by '123456'; Query OK, 0 rows affected (0.06 sec) 用户创建完成后,刷新授权 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) 2.删除用户 drop user "用户名"@"IP地址"; 3.修改用户 rename user "用户名"@"ip地址" to "新用户名"@"IP地址"; 4.修改密码 set password for "用户名"@"ip地址" = password("新密码"); 二、用户授权 1.查看权限 show grants for "用户名"@"ip地址"; 2.授权某一个用户所有的权限,除了grant这个命令,grant命令只有root才可以使用 grant all

MySQL创建用户与授权

蹲街弑〆低调 提交于 2019-11-28 15:21:48
MySQL创建用户与授权 一. 创建用户 命令: CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明: username:你将创建的用户名 host:指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost,如果想让该用户可以 从任意远程主机登陆 ,可以使用通配符 % password:该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登陆服务器 例子: CREATE USER '用户名'@'localhost' IDENTIFIED BY '123456'; CREATE USER '用户名'@'192.168.1.101_' IDENDIFIED BY '123456';CREATE USER '用户名'@'%' 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

Query grants for a table in postgres

╄→尐↘猪︶ㄣ 提交于 2019-11-28 15:14:13
问题 How can I query all GRANTS granted to an object in postgres? For example I have table "mytable": GRANT SELECT, INSERT ON mytable TO user1 GRANT UPDATE ON mytable TO user2 I need somthing which gives me: user1: SELECT, INSERT user2: UPDATE 回答1: \z mytable from psql gives you all the grants from a table, but you'd then have to split it up by individual user. 回答2: I already found it: SELECT grantee, privilege_type FROM information_schema.role_table_grants WHERE table_name='mytable' 回答3: If you

Give all the permissions to a user on a DB

假装没事ソ 提交于 2019-11-28 15:07:16
I would like to give an user all the permissions on a database without making it an admin. The reason why I want to do that is that at the moment DEV and PROD are different DBs on the same cluster so I don't want a user to be able to change production objects but it must be able to change objects on DEV. I tried: grant ALL on database MY_DB to group MY_GROUP; but it doesn't seem to give any permission. Then I tried: grant all privileges on schema MY_SCHEMA to group MY_GROUP; and it seems to give me permission to create objects but not to query\delete objects on that schema that belong to other

【MySQL】用户管理及备份

人盡茶涼 提交于 2019-11-28 15:06:56
原文: http://blog.gqylpy.com/gqy/243 我们知道我们的最高权限管理者是root用户,它拥有着最高的权限,包括select、update、delete、grant等操作。一般在公司里DBA工程师会创建一个用户和密码,让你去连接数据库的操作,并给当前的用户设置某个操作的权限(或者所有权限)。 ___ 1. 对新用户增删改 # 创建用户 create user 'zyk'@'192.168.1.2' identified by '123'; # 指定ip为192.168.1.2的zyk用户登陆 create user 'zyk'@'192.168.%.%' identified by '123'; # 指定ip为192.168.开头的zyk用户登陆 create user 'zyk'@'%' identified by '123'; # 指定任何ip的zyk用户登陆 # 删除用户 drop user '用户名'@'可访问途径'; # 修改用户 rename user '用户名'@'可访问路径' to '新用户名'@'可访问路径'; # 修改密码 set password for '用户名'@'可访问路径'=Password('新密码'); # 取消全局密码复杂度策略 set global validate_password_policy=0; 2.

What GRANT USAGE ON SCHEMA exactly do?

冷暖自知 提交于 2019-11-28 13:56:22
问题 I'm trying to create for the first time a Postgres database, so this is probably a stupid question. I assigned basic read-only permissions to the db role that must access the database from my php scripts, and I have a curiosity: if I execute GRANT some_or_all_privileges ON ALL TABLES IN SCHEMA schema TO role; is there any need to execute also GRANT USAGE ON SCHEMA schema TO role; ? From documentation: USAGE: For schemas, allows access to objects contained in the specified schema (assuming

mysql GRANT + WHERE

喜你入骨 提交于 2019-11-28 12:28:45
I want to give permissions only to specificated rows in mysql. table: messages cols: from, to, message GRANT ALL ON db.messages TO 'jeffrey'@'localhost' WHERE messages.from = 'jeffrey' OR messages.to = 'jeffrey' ; With a thing like this the user only can access only his own messages. Do you know how to solve the problem? Per the GRANT command, there is no ability to set permission-levels on a per-row basis (table/columns, yes - but not the individual rows). You could setup a View to handle this though and grant the user permission to access the view instead. A view such as the following should

入门MySQL——用户与权限

和自甴很熟 提交于 2019-11-28 11:24:57
前言: 前面几篇文章为大家介绍了各种SQL语法的使用,本篇文章将主要介绍MySQL用户及权限相关知识,如果你不是DBA的话可能平时用的不多,但是了解下也是好处多多。 1.创建用户 官方推荐创建语法为: CREATE USER [IF NOT EXISTS] user [auth_option] [, user [auth_option]] ... [REQUIRE {NONE | tls_option [[AND] tls_option] ...}] [WITH resource_option [resource_option] ...] [password_option | lock_option] ... user: (see Section 6.2.4, “Specifying Account Names”) auth_option: { IDENTIFIED BY 'auth_string' | IDENTIFIED WITH auth_plugin | IDENTIFIED WITH auth_plugin BY 'auth_string' | IDENTIFIED WITH auth_plugin AS 'auth_string' | IDENTIFIED BY PASSWORD 'auth_string' } tls_option: { SSL | X509 |

入门MySQL——用户与权限

我只是一个虾纸丫 提交于 2019-11-28 10:57:54
前言: 前面几篇文章为大家介绍了各种SQL语法的使用,本篇文章将主要介绍MySQL用户及权限相关知识,如果你不是DBA的话可能平时用的不多,但是了解下也是好处多多。 1.创建用户 官方推荐创建语法为: CREATE USER [IF NOT EXISTS] user [auth_option] [, user [auth_option]] ... [REQUIRE {NONE | tls_option [[AND] tls_option] ...}] [WITH resource_option [resource_option] ...] [password_option | lock_option] ... user: (see Section 6.2.4, “Specifying Account Names”) auth_option: { IDENTIFIED BY 'auth_string' | IDENTIFIED WITH auth_plugin | IDENTIFIED WITH auth_plugin BY 'auth_string' | IDENTIFIED WITH auth_plugin AS 'auth_string' | IDENTIFIED BY PASSWORD 'auth_string' } tls_option: { SSL | X509 |