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

 创建一个权限有限的用户给别人使用
# 创建用户阶段
# 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:UsersAdministrator>mysql -u用户名 -p密码 登陆本地的数据库
# C:UsersAdministrator>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


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