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

mysql的创创建用户阶段 开启客户端登录和授权阶段

时间:2018-12-15 22:33:05      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:let   tor   用户名   str   客户端   mys   sele   oca   登陆   

 创建一个权限有限的用户给别人使用
# 创建用户阶段
# mysql> create user ‘yuan‘@‘localhost‘;
# mysql> create user ‘alex‘@‘localhost‘ identified by ‘123‘;
# mysql> create user ‘alex‘@‘192.168.11.22‘ identified by ‘123‘;
# mysql> create user ‘alex‘@‘192.168.11.%‘ identified by ‘123‘;
# 开启客户端登陆
# C:\Users\Administrator>mysql -u用户名 -p密码 登陆本地的数据库
# C:\Users\Administrator>mysql -u用户名 -p密码 -h你要登陆的机器的ip地址
# 授权阶段
# mysql> grant all on mysql.user to ‘yuan‘@‘localhost‘;
# mysql> grant select on mysql.user to ‘yuan‘@‘localhost‘;
# mysql> grant select,insert on mysql.user to ‘yuan‘@‘localhost‘;
# mysql> grant select,insert on mysql.* to ‘yuan‘@‘localhost‘;
# mysql> grant select,insert on *.* to ‘yuan‘@‘localhost‘; 所有库的,所有表给用户查和增的权限
# select,insert,delete,update


mysql的创创建用户阶段 开启客户端登录和授权阶段

标签:let   tor   用户名   str   客户端   mys   sele   oca   登陆   

原文地址:https://www.cnblogs.com/liurenli/p/10125086.html

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