mysql 基本命令

创建新用户

insert into mysql.user(host, user, password)
values("localhost", "dev", password("admin"))

 

刷新系统权限表

mysql>flush privileges; 

 

授权min用户拥有tree数据库的所有权限

mysq>grant all privileges on tree.* to dev@localhost identified by 'admin'; 

 

删除用户

mysql>DELETE FROM mysql.user WHERE User="dev" and Host="localhost"; 

 

修改用户密码

mysql>update mysql.user set password=password('123456')    
where User="dev" and Host="localhost"; 

  

你可能感兴趣的:(mysql)