mysql权限分配
标签(空格分隔): 工作总结
update mysql.user set authentication_string=password(‘qj12345678@’) where user=‘aliyun_root’;
change master to master_host=‘rm-2ze017xqkb7dn9006.mysql.rds.aliyuncs.com’,master_port=3306,master_user=‘repl’,master_password=‘repl123456@’,master_auto_position=0;
root allqj123456@
运维(Operation and maintenance)
dbadmin devops123456@
grant all privileges on *.* to root@'%' identified by 'devops123456@' with grant option;
create user dbadmin identified by 'devops123456@';
grant all privileges on *.* to dbadmin@'60.2.82.30' identified by 'devops123456@' with grant option;
grant all privileges on *.* to admin@'%' identified by 'devops123456@' with grant option;
grant all privileges on *.* to dbadmin@'39.105.191.156' identified by 'devops123456@' with grant option;
开发组长(Development team leader)
dbadmin_leader dtl123456@
create user dbadmin_leader identified by 'dtl123456@';
grant all privileges on *.* to dbadmin_leader@'60.2.82.30' identified by 'dtl123456@';
开发和程序 (Development and procedures)
dbadmin_app dap12345678@
create user dbadmin_app identified by 'dap12345678@';
grant SELECT, INSERT,UPDATE,DELETE,EXECUTE,EVENT,TRIGGER,ALTER,FILE, CREATE VIEW, SHOW VIEW on *.* to dbadmin_app@'60.2.82.30' identified by 'dap12345678@';
grant all privileges on *.* to dbadmin_app@'39.105.191.156' identified by 'dap12345678@';
测试人员(Testers)
dbadmin_test ts12345678@
create user dbadmin_test identified by 'ts12345678@';
grant SELECT, CREATE VIEW, SHOW VIEW on *.* to dbadmin_test@'%' identified by 'ts12345678@';
grant SELECT, CREATE VIEW, SHOW VIEW on *.* to root@'%' identified by 'ALLqj123456@#$';
复制权限
prod: repl qj123456@
pred: repl repl123456@
hr_record_message_num
# 创建用户
db.createUser(
{
user: "dbadmin",
pwd: "qj123456789",
roles: [{ role: "readWrite", db: "wecenter" }]
}
)
# 更新用户
db.updateUser(
"dbadmin",
{
pwd: "qj123456789",
roles: [{ role: "dbOwner", db: "brd_contract_management_new" }]
}
)