Home > Database > Mysql Tutorial > mysql数据库添加用户及分配权限具体实现_MySQL

mysql数据库添加用户及分配权限具体实现_MySQL

PHP中文网
Release: 2016-05-27 14:12:06
Original
1493 people have browsed it

bitsCN.com 创建用户并分配权限;

insert into mysql.user(Host,User,Password) values("localhost","phplamp",password("1234"));//创建用户 
grant all privileges on dbname.* to 'username'@'%' identified by 'password';//创建用户并分配所有权限 
grant select,update on phplampDB.* to phplamp@localhost identified by '1234';//创建用户并分配权限 
update mysql.user set password=password('新密码') where User="phplamp" and Host="localhost";//修改用户密码
Copy after login

--删除用户指定权限

revoke insert,update,delete,select ON *.* from 'xbb'@'localhost' IDENTIFIED BY '123';
Copy after login


 以上就是mysql数据库添加用户及分配权限具体实现_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!


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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template