Home  >  Article  >  Database  >  Mysql账户管理_MySQL

Mysql账户管理_MySQL

WBOY
WBOYOriginal
2016-06-01 13:36:22892browse

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
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn