mysql授权多个IP

以123.123.123.123 、123.123.123.124两个IP地址的用户访问db1为例,分别创建用户名user1、user2

1、为123.123.123.123上创建用户user1

create user ‘user1’@’123.123.123.123’ IDENTIFIED BY ‘XXXXXXX’;

grant select on db1.table1 to ‘user1’@’123.123.123.123’ ;

2、为123.123.123.124上创建用户user2

create user ‘user2’@’123.123.123.124’ IDENTIFIED BY ‘YYYYY’;

grant select on db1.table1 to ‘user2’@’123.123.123.124’ ;

说明:用户是按IP区分的,不同IP用户名可以相同

百度大模型

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

腾讯云图