grant

mysql root password

徘徊边缘 提交于 2019-12-18 04:21:51
""" centos: mysql忘记root密码解决 1.修改MySQL的登录设置: # vim /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-grant-tables 2.重启mysql systemctl restart mysqld.service 3.登录mysql mysql 4.修改root用户密码: 先将密码设置为空 update user set authentication_string='' where user='root' 再修改密码 ALTER user 'root'@'localhost' IDENTIFIED BY 'Cliu123#' 如果遇到The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 则刷新权限即可(FLUSH PRIVILEGES) 注意: 一定不要采取如下形式该密码: use mysql; update user set authentication_string="newpassword"

Give all the permissions to a user on a DB

ぃ、小莉子 提交于 2019-12-17 21:24:40
问题 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

Execute Immediate fails even with CREATE table grant

六月ゝ 毕业季﹏ 提交于 2019-12-17 21:06:07
问题 I have a problem where I am creating a table using the execute immediate command in the stored procedure. However I get the error of "insufficient privileges". I checked other threads and made sure that the user has "CREATE TABLE" privilege granted to it. However I still keep seeing the same error. SQL> select * from USER_SYS_PRIVS; USERNAME PRIVILEGE ADM ------------------------------ ---------------------------------------- --- MYUSER CREATE VIEW NO MYUSER UNLIMITED TABLESPACE NO SQL>

Grant SELECT on multiple tables oracle

给你一囗甜甜゛ 提交于 2019-12-17 20:05:27
问题 I have 3 tables table1,table2,table3. I want to grant(select for example) these tables to a user, user1. I know that I can grant with: grant select on table1 to user1; grant select on table2 to user1; grant select on table3 to user1; Can I grant the 3 tables to user1 using only 1 query? Thanks 回答1: No. As the documentation shows, you can only grant access to one object at a time. 回答2: You can do it with dynamic query, just run the following script in pl-sql or sqlplus: select 'grant select on

MySQL安装、配置与优化

无人久伴 提交于 2019-12-17 18:53:52
首先打开MySQL官网选择安装包 添加链接描述 在centOS中输入uname -a查看系统版本 打开MySQL官网选择安装包 在centOS中输入uname -a查看系统版本 然后下载并解压上传 比如我的是el7.x86_64,我们选择Red Hat Enterprise Linux /Oracle Linux的安装包,选择下载上面的mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar这个压缩包,下载时选择No thanks, just start my download开始下载,不需要登录等操作。下载完成后将压缩包解压后通过Xftp软件上传至centos服务器上即可。 安装设置 我们在安装mysql之前需要确认本机是否已经安装了mysql,使用命令rpm -qa | grep mysql查看是否已经安装了mysql,另外还需要使用rpm -qa|grep -i mariadb查看是否已经安装了Mariadb 的数据库版本。如果已安装的话,需要使用yum -y remove命令进行卸载。接下来我们安装依赖包,使用yum -y install make gcc-c++ cmake bison-devel ncurses-devel libaio libaio-devel安装。使用rpm -ivh 命令分别安装common、libs、server

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

我的未来我决定 提交于 2019-12-17 17:29:06
问题 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

Grant all on a specific schema in the db to a group role in PostgreSQL

为君一笑 提交于 2019-12-17 04:15:40
问题 Using PostgreSQL 9.0, I have a group role called "staff" and would like to grant all (or certain) privileges to this role on tables in a particular schema. None of the following work GRANT ALL ON SCHEMA foo TO staff; GRANT ALL ON DATABASE mydb TO staff; Members of "staff" are still unable to SELECT or UPDATE on the individual tables in the schema "foo" or (in the case of the second command) to any table in the database unless I grant all on that specific table. What can I do make my and my

Oracle 学习笔记(二)

隐身守侯 提交于 2019-12-17 03:48:56
1.创建用户,一般是具有dba权限的用户才能使用:   create user 用户名 identified by 密码; 2.删除用户:   drop user 用户名,注意,如果用户拥有对象,则不能直接删除,否则将返回一个错误值。指定关键字cascade,可删除用户所有的对象,然后再删除用户,如:   drop user 用户名 cascade; 3.授权,将连接的权限授予一个用户:   grant connect to 用户名; 只有表的所有者和管理员才可以授权别人查看自己的表。例如,为其他用户添加一个某张表的select权限。   grant select on 表名 to 用户名; 权限传递:   grant select on 表名 to 用户名 with grant option;(对象权限)   grant connect to 用户名 with admin option;(系统权限) 4.收回权限(这个是级联收回权限,也就是如果该用户给了又给了另外人权限,那么那个人的权限也要被回收)   revoke select on 表名 from 用户名; 5.账户锁定(输入最多3次密码,失败后会锁定2天时间)   create profile 名称 limit failed_login_attempts 3 password_lock_time 2; 6.解锁  

mysql权限管理

丶灬走出姿态 提交于 2019-12-17 03:33:26
mysql权限管理 1、新增用户 mysql>CREATE USER ‘username‘@‘host‘ IDENTIFIED BY ‘password‘; host:主机ip,%【任意ip】 localhost【本机】 192.168.31.22【指定ip】 IDENTIFIED BY:将密码用默认的加密方式进行加密后放入表中,不直接存放可以明码 默认的加密方式需要查一下user表中的plugin,如果客户端不支持,可以指定加密方式进行加密 mysql>CREATE USER 'username'@'host' IDENTIFIED MySqlSHA1 BY 'password'; 新增后的用户默认是没有任何权限的,也就是useage,只能登陆罢了 更新用户密码: >update user set password=PASSWORD(‘123456’) where User='root' 该表,是用户远程登陆 mysql -u root –p mysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2、查看和管理用户权限 1、查看当前用户的权限 MariaDB [(none)]> show grants; 2

用户管理

和自甴很熟 提交于 2019-12-17 01:17:52
一、创建用户 概述:在oracle中要创建一个新的用户使用create user语句,一般是具有dba(数据库管理员)的权限才能使用。 create user 用户名 identified by 密码; 注意:oracle有个毛病,密码必须以字母开头,如果以数字开头,它不会创建用户 eg、create user xiaoming identified by oracle; 二、给用户修改密码 概述:如果给自己修改密码可以直接使用 SQL> password 用户名或passw 如果给别人修改密码则需要具有dba的权限,或是拥有alter user的系统权限 SQL> alter user 用户名 identified by 新密码 三、删除用户 概述:一般以dba的身份去删除某个用户,如果用其它用户去删除用户则需要具有drop user的权限。 比如drop user 用户名 【cascade】 注意:在删除用户时,如果要删除的用户,已经创建了表,那么就需要在删除的时候带一个参数cascade,即把该用户及表一同删除; 四、权限 权限分为系统权限和对象权限。 何为系统权限? 用户对数据库的相关权限,connect、resource、dba等系统权限,如建库、建表、建索引、建存储过程、登陆数据库、修改密码等。 何为对象权限? 用户对其他用户的数据对象操作的权限,insert