杂项

 

CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP, ALTER ON ELEPayServer.* TO usereleusr@'%' Identified by 'passwd'; 增加权限

REVOKE SELECT, INSERT, UPDATE, DELETE, CREATE, DROP,ALTER ON `ELEPayServer`.* FROM 'usereleusr'@'%'; 去掉权限

SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;  查看所有用户

show grants for user@'ip' 查看某个用户赋予的权限

REVOKE 权限 ON *.* FROM 'user'@'%';查到什么权限删什么权限

select host,user from mysql.user; 查看mysql 用户权限

Delete FROM user Where User='root' and host='ip'; 删除用户

update mysql.user set Host='%' where HOST='localhost' and User='root';  mysql5.7 允许root远程访问
update user set authentication_string=password('123456') where user='app' and Host='localhost';  更新密码
 
flush privileges;

  

 

 

  

 

posted @ 2018-01-15 18:18  执酒  阅读(134)  评论(0编辑  收藏  举报