雜項

 

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'; 刪除用戶
 
flush privileges;

  

update mysql.user set Host='%' where HOST='localhost' and User='root';  mysql5.7 容許root遠程訪問
flush privileges;
相關文章
相關標籤/搜索