数据库
首页 > 数据库> > Mysql 创建用户并授权方法

Mysql 创建用户并授权方法

作者:互联网

一、创建用户

root 用户登陆,切换到mysql 数据库:

create user 'test'@"%" identified by 'test123'; create user 'test'@‘localhost' identified by 'test123'; create user 'qa'@'localhost' identified by 'qa123456';

二、授予权限

grant all privileges on *.* to test@‘%’; grant all privileges on *.* to test@‘localhost’; grant all privileges on *.* to qa@'localhost';

三、刷新权限

flush privileges; 

四、修改用户密码

切换到mysql 数据库: use mysql;

update user set password=password("cx_qa123456") where user="cx_test"; flush privileges;  

标签:创建,privileges,mysql,user,Mysql,test,授权,create,localhost
来源: https://www.cnblogs.com/keenajiao/p/15907346.html