首页 > 数据库技术 > 详细

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

时间:2016-05-24 16:32:51      阅读:175      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!