GRANT Select ON *.* TO reader@192.168.1.123 IDENTIFIED BY "123456" GRANT 可以立刻生效 在mysql 5.6下似乎要重启mysql才生效 创建了一个账户名为“reader" , 密码”123456“ 只可以从192.168.1.123发起访问 读取数据库的账号 reader@"%" 则表示所有的ip都可以访问 参考: http://linux.chinaitlab.com…
应用场景:只要公司有数据团队的,那免不了让这帮家伙把全公司的数据库数据都摸一遍,但是要是直接把root用户给了他们,未免有点危险,于是只能给这帮人设权限,一般而言,他们只是做读操作,既然做读操作,那么只要有个select权限就可以了. 我们可以通过GRANT来创建用户: GRANT SElECT ON *.* TO 'read_only_user'@'ip' IDENTIFIED BY "pa$$word" 其实这个语句与开通远程连接差不多,read_only_user就是用户名,随便…
mysql 创建只读账户: 1.查询所有账号信息 SELECT DISTINCT a.`User`,a.`Host`,a.password_expired,a.password_last_changed,a.password_lifetime,a.* FROM mysql.user a; 示例: 1.创建账户 并授权SELECT查询权限. > GRANT SELECT ON dbname.* TO 'username'@'%' IDENTIFIED BY "password";…
grant select on xoms_prod.* to 'kzcf'@'%' identified by '123456'; 赋权多权限就 grant select,update,delete on xoms..... flush privileges; 然后这个语句保存权限show grants for kzcf; kzcf就是用户名 那个 %号表示所有机器都能访问 ==================在navicat-SQL执行界面,执行下面这条SQL语句 GRANT…
创建只读用户:grant connect to user; grant create session to user; 1.创建角色 CREATE ROLE SELECT_ROLE 2.给角色分配权限 grant SELECT ANY DICTIONARY to SELECT_ROLE; grant SELECT ANY TABLE to SELECT_ROLE; grant SELECT ANY TRANSACTION to SELECT_ROLE; grant SELECT ANY SEQU…
1.创建用户,指定哪个表空间create user test2 identified by "123" default tablespace BDCDJ_XC temporary tablespace BDCDJ_XC_temp; 2.创建角色 CREATE ROLE SELECT_ROLE 3.给角色分配权限 grant connect to SELECT_ROLE; grant create synonym to SELECT_ROLE; 4.分配某些表的select权限如:gra…
-- 赋予某个库全部权限use mysql;grant all privileges on test_db.* to test_user@'%' identified by 'Aa123456';grant all privileges on test_db.* to test_user@'localhost' identified by 'Aa123456';flush privileges; -- 赋予某个库增删改查权限use mysql;grant select,insert,update…
1.创建账号1)只读账号GRANT USAGE ON *.* TO 'testgao_r'@'192.168.1.1' IDENTIFIED BY 'password' WITH MAX_QUERIES_PER_HOUR 14400000 MAX_UPDATES_PER_HOUR 7200000 MAX_CONNECTIONS_PER_HOUR 14400000 MAX_USER_CONNECTIONS 2000;GRANT SELECT, EXECUTE, SHOW VIEW ON `test…