码迷,mamicode.com
首页 > 数据库 > 详细

mysql 新建用户、授权、远程访问

时间:2016-05-24 16:34:56      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:

新建用户

insert into mysql.user(Host,User,Password) values("localhost","u",password("123"));
flush privileges;
grant all privileges on uDB.* to u@localhost identified by ‘123‘;
flush privileges;
grant select,update on uDB.* to u@localhost identified by ‘123‘;
flush privileges;
DELETE FROM user WHERE User="u" and Host="localhost";
flush privileges;

  

远程访问

update mysql.user set host = ‘%‘ where user = ‘u‘;
grant all privileges on *.* to ‘u‘@‘%‘ identified by ‘123‘

  

权限回收

revoke privileges on dbname[.tbname] from username;

  

mysql 新建用户、授权、远程访问

标签:

原文地址:http://www.cnblogs.com/yanjunhelloworld/p/5523656.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!