[MySQL]增加用户 授权 远程登录

栏目: IT技术 · 发布时间: 4年前 · 38

mysql创建用户和授权

1.创建用户:

(注意:下面的指令,请在root用户下输入)

CREATE USER "用户名" IDENTIFIED BY "密码";

如果要限制地址登录:

例如只允许本地的用户登录@localhost

CREATE USER 用户名@地址 IDENTIFIED BY '密码';

mysql 创建完用户之后,需要对该用户进行授权。授权之后,改用户才能有执行命令的权利!

2.授权

GRANT ALL PRIVILEGES ON 数据库.* TO '用户名'@'登录主机' IDENTIFIED BY "密码";
  • grant select,insert,update,delete on . to test1@”%” Identified by “abc”;
  • 格式:grant select on 数据库.* to 用户名@登录主机 identified by “密码”
  • 如果想授权用户可以操作所有的数据:.(数据库写为:*)
  • 如果不限制登录主机:’用户名’@’%’(登录主机写为:%)
FLUSH PRIVILEGES;
猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to the Design and Analysis of Algorithms

Introduction to the Design and Analysis of Algorithms

Anany Levitin / Addison Wesley / 2011-10-10 / USD 117.00

Based on a new classification of algorithm design techniques and a clear delineation of analysis methods, Introduction to the Design and Analysis of Algorithms presents the subject in a coherent a......一起来看看 《Introduction to the Design and Analysis of Algorithms》 这本书的介绍吧!

UNIX 时间戳转换

UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换

RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具

RGB CMYK 转换工具

RGB CMYK 互转工具