Home > Database > Mysql Tutorial > mysql用户管理_MySQL

mysql用户管理_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:53:28
Original
774 people have browsed it

msyql里所有的用户都是在mysql.user表里

可以直接操作这个表来进行添加删除修改用户的操作.

mysql提供了一种更简单的方法来操作用户及权限.grant和revoke命令

GRANT 权限1,权限2 (ALL全部;UASGE无权限)
 ON 库.表 (*.*)
 TO "用户名"@"地址" (@%所有地址 @192.168.1.%网段下 @.mayongzhan.com域名下)
 INDENTIFIED BY "密码" (不写此句则没有密码)
 WITH GRANT OPTION (管理用户的权限)
GRANT select,update,delete
 ON myz.myztest
 TO "user"@"127.0.0.1"
 IDENTIFIED BY "password"
 WITH GRANT OPTION

上面是添加用户分配权限

下面是删除用户及权限

REVOKE privileges (columns) ON what FROM user

上面这句只是删除权限.并没有删除用户,删除用户使用下面这句

DELETE FROM user ->WHERE User="user_name" and Host="host_name";

FLUSH PRIVILEGES (重载授权表.grant和revoke自动执行此句.直接操作user表时不执行)

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template