grant

【MySQL】用户管理及备份

主宰稳场 提交于 2019-11-27 20:45:48
"我们知道我们的最高权限管理者是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. 对当前的用户授权 # 查看权限 show grants for '用户名'@

How can I restrict a MySQL user to a particular tables

最后都变了- 提交于 2019-11-27 20:09:13
How can I restrict a user_account in MySQL database to a particular tables. Ex: UserName: RestrictedUser DatabaseName: db_Payroll TableName: tb_Employees tb_Users tb_Payroll_YYMMDD tb_Payroll_Processed I want to restrict "RestrictedUser" to tb_Users and tb_Employees only and the rest of the tables of db_Payroll that will be created for future use is granted to have access. Assuming the user has no current privileges, you can do the following GRANT SELECT, INSERT, DELETE ON db_Payroll.tb_Users TO RestrictedUser@'%' GRANT SELECT, INSERT, DELETE ON db_Payroll.tb_Employees TO RestrictedUser@'%'

How to grant all privileges on views to arbitrary user

依然范特西╮ 提交于 2019-11-27 20:06:49
How do you grant read/select access on all functions and views to an arbitrary user? I use psql --user=postgres -d mydb -f myview.sql to create several functions and views, and then I run: GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser; Having been granted all privileges, I would expect myuser to now have access to the functions and views created by the postgres user. However, when I try and access them with myuser , I get a "permission denied for relation..." error. Why is this? Erwin Brandstetter The reason is that you need additional privileges to access a view or table. Privileges on the

【MySQL】用户管理及备份 -- 2019-08-17 01:45:29

本秂侑毒 提交于 2019-11-27 14:17:07
原文: 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.

【MySQL】用户管理及备份 -- 2019-08-17 01:38:17

末鹿安然 提交于 2019-11-27 14:16:40
原文: 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.

配置mysql 允许远程连接的方法(包括服务器配置、MySQL数据库配置)

社会主义新天地 提交于 2019-11-27 13:32:37
一般情况分三个地方准备, MySQL 数据库 ,防火墙,还有你的服务器主机的准备 操作系统 为centos6.5。其他系统大致差不多。 1:在服务器中安装 mysql ,具体安装过程,请自行查询。安装好后,输入mysql -u root -p,再输入密码(输入密码时,密码不会显示)就会进入到MySQL如下界面。 2:进入MySQL后,show databases; use mysql; select User,Host,Password from user; 如果没有root % 这一行。输入grant all privileges on *.* to "root"@"%" identified by "密码"; flush privileges; 之后查看是否有下面这一行。如果有,则数据库方面就准备就绪。 2:防火墙方面。 查询防火墙状态: service iptables status<回车> 停止防火墙: service iptables stop <回车> 启动防火墙: service iptables start <回车> 重启防火墙: service iptables restart <回车> 永久关闭防火墙: chkconfig iptables off<回车> 永久关闭后启用: chkconfig iptables on<回车> 查看防火墙状态后如图

oracle从建立用户到数据库备份

别等时光非礼了梦想. 提交于 2019-11-27 13:03:42
一:创建临时表空间 create temporary tablespace IAF_DATA_TEMP tempfile 'IAF_DATA_TEMP.DBF' size 20GB autoextend on; 二:创建数据表空间 create tablespace IAF_DATA logging datafile 'IAF_DATA.DBF' size 30GB autoextend on; 三:创建用户并指定表空间 create user user_p identified by user_p default tablespace IAF_DATA temporary tablespace IAF_DATA_TEMP profile default; 四:用户授权 grant connect to user_p; grant resource to user_p; grant dba to user_p; grant unlimited tablespace to user_p; 五:备份数据库 exp user_p/user_p@ORCL file=D:\DB_BUP_20190726\odsuser_dj.dmp log=D:\DB_BUP_20190726\odsuser_dj.log 六:导入数据库 imp user_p/user_p@localhost:1521

Linux环境使用Docker安装MySql

风格不统一 提交于 2019-11-27 12:53:14
系统环境: CentOS 7.6 64位(同样适用于Ubuntu) 安装步骤: 1.创建文件夹 /home/docker/mysql/config /home/docker/mysql/data 2.在config目录下创建并编辑配置字符集文件 输入命令:vi my.cnf [mysqld] user=mysql character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8 3.下载镜像并用外部匿名卷挂载配置和数据 $ docker run \ -d -p 3306:3306 \ -e MYSQL_USER="vinson" -e MYSQL_PASSWORD="Pwd@123456" -e MYSQL_ROOT_PASSWORD="Pwd@123456" \ --name mysql \ -v /home/docker/mysql/config/my.cnf:/etc/my.cnf -v /home/docker/mysql/data:/var/lib/mysql \ mysql/mysql-server 4.进入MySql设置权限(使用root账号设置管理员权限,不设置无法创建数据库) $ docker exec -it mysql bash $

How to grant remote access to MySQL for a whole subnet?

纵然是瞬间 提交于 2019-11-27 11:04:22
I can easily grant access to one IP using this code: $ mysql -u root -p Enter password: mysql> use mysql mysql> GRANT ALL ON *.* to root@'192.168.1.4' IDENTIFIED BY 'your-root-password'; mysql> FLUSH PRIVILEGES; But i need to allow the whole subnet 192.168.1.* to access the database remotely. How can i do that? EDIT: Consider looking at and upvoting Malvineous 's answer on this page. Netmasks are a much more elegant solution. Simply use a percent sign as a wildcard in the IP address. From http://dev.mysql.com/doc/refman/5.1/en/grant.html You can specify wildcards in the host name. For example,

Why is GRANT not working in MySQL?

夙愿已清 提交于 2019-11-27 10:27:51
问题 I'm scratching my head on this one as I see a ton of helper websites showing how to create MySQL users and grant privileges but for some reason it just does not work for me. I tried on both WinXP and a MacBook Pro laptop with the latest MySQL version installed. The following is just an example from when I worked with WordPress. The actual database is something different but same issues. Here are the steps: mysql> mysql -uroot -p<password> mysql> CREATE DATABASE wwordpress; mysql> CREATE USER