首页  >  文章  >  数据库  >  Mysql账户管理_MySQL

Mysql账户管理_MySQL

WBOY
WBOY原创
2016-06-01 13:36:22892浏览

bitsCN.com

Mysql账户管理

 

1、创建账户 

Shell代码  

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'my pass';  

2、删除账户(删除账户同时会删除其所有权限) 

Shell代码  

DROP USER 'jeffrey'@'localhost';  

 

3、分配权限 

Shell代码  

GRANT ALL PRIVILEGES ON *.* TO 'jeffrey'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION  

 

4、回收权限 

Shell代码  

REVOKE INSERT ON *.* FROM 'jeffrey'@'localhost';  

REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'jeffrey'@'localhost';  

5、账户更名 

Shell代码  

RENAME USER 'jeffrey'@'localhost' TO 'jeff'@'127.0.0.1';  

 

6、修改密码 

Shell代码  

SET PASSWORD = PASSWORD('mypass');  

SET PASSWORD FOR 'jeffrey'@'localhost' = PASSWORD('mypass');  
 

bitsCN.com
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn