标签:ide alt ESS database replica databases 操作 dmi date
操作对象:线上和测试所有MySQL Plus数据库
create user ‘testname‘@‘%‘ identified by ‘123456‘;
show grants for testname;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX,ALTER,SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON *.* TO ‘testnam‘@‘%‘;
#创建用户并授权
GRANT ALL PRIVILEGES ON *.* TO ‘testname‘@‘%‘IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX,ALTER,SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER
select * from mysql.user where User=‘testname‘ and Host=‘%‘\G;
update mysql.user set Grant_priv=‘Y‘ where User=‘testname‘ and Host=‘%‘;
flush privileges;
CREATE,DROP,ALTER
revoke CREATE,DROP,ALTER on *.* from testname@‘%‘;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON *.* TO ‘testname1‘@‘%‘;
mysqladmin -u testname1 -h1.1.1.1 password C123456 "c123456"
修改密码:
set password = password ‘C123456‘;
标签:ide alt ESS database replica databases 操作 dmi date
原文地址:http://blog.51cto.com/niuduzi/2170372