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

MySQL命令记录

时间:2018-01-04 13:07:05      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:log   sele   登录   ant   word   username   blog   记录   host   

1,授权用户远程访问

grant all privileges on *.* to ‘username‘@‘%‘ identified by ‘password‘ with grant option;

flush privileges;

 

2,登录

mysql -u"username" -p"pwd" -hlocalhost -P3306

 

3,创建只读帐户

GRANT SELECT ON *.* TO ‘username_r‘@‘localhost‘ IDENTIFIED BY ‘pwd‘;

 

4,创建读写账户

GRANT ALL ON *.* TO ‘username_r‘@‘localhost‘ IDENTIFIED BY ‘pwd‘;

MySQL命令记录

标签:log   sele   登录   ant   word   username   blog   记录   host   

原文地址:https://www.cnblogs.com/gm-201705/p/8192600.html

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