mysql 指定域_MySQL允许从特定域访问?(MySQL allow access from specific domain?)

在MySQL中,可以通过GRANT命令指定用户从特定域名访问数据库,例如`GRANT ALL PRIVILEGES ON mydatabase.* to jsmith@'somedomain' IDENTIFIED BY 'jimspassword';`。即使在my.cnf文件中没有绑定IP,只要在GRANT语句中设置了域名,用户仍可以从该域内的任何IP地址访问。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MySQL允许从特定域访问?(MySQL allow access from specific domain?)

我试图允许访问我在本地服务器上运行的MySQL实例。 我知道我可以在my.cnf文件中绑定对某些IP和某些IP范围的远程访问。 我很好奇是否可以允许从整个域访问,而不必列出可能连接的所有可能的IP。

我知道您可以通过GRANT命令授予对整个域的访问权限,但我想我的断开连接是my.cnf文件如何使用它。

例如,如果我

GRANT ALL PRIVILEGES ON mydatabase.* to jsmith@'somedomain' IDENTIFIED BY 'jimspassword';

但是,在my.cnf文件中没有任何IP限制它仍然可以工作吗?

谢谢你的帮助

I'm trying to allow access to the MySQL instance I have running on a local server here. I know I can bind remote access to certain IP's and certain IP ranges in the my.cnf file. I was curious if it was possible to allow access from entire domains rather than having to list out all the possible IP's that might be connecting.

I know you can grant access to entire domains via the GRANT command but i guess my disconnect is how the my.cnf file works with this.

Example if I

GRANT ALL PRIVILEGES ON mydatabase.* to jsmith@'somedomain' IDENTIFIED BY 'jimspassword';

but then don't have any IP's bound in the my.cnf file will it still work?

thanks for any help

原文:https://stackoverflow.com/questions/17089526

更新时间:2019-11-24 17:11

最满意答案

帐户名称和密码

[ deletia ]

您可以在主机名中指定通配符。 例如, user_name @'%.example.com'适用于example.com域中任何主机的user_name @'192.168.1.%' , user_name @'192.168.1.%'适用于192.168.1 C类子网中任何主机的user_name 。

As documented under GRANT Syntax:

Account Names and Passwords

[ deletia ]

You can specify wildcards in the host name. For example, user_name@'%.example.com' applies to user_name for any host in the example.com domain, and user_name@'192.168.1.%' applies to user_name for any host in the 192.168.1 class C subnet.

2013-06-13

相关问答

您的代码的问题是%w(domains)是["domains"] 你可以这样做: # routes.rb

Domain.find_each do |d|

constraints(subdomain: d.domain) do

get "/*structure" => "pages/dashboard/sites/pages#show"

end

end

有关更多信息: http : //edgeguides.rubyonrails.org/routing.html#request-b

...

这将允许您根据传入端口重定向,但假设apache正在侦听所有端口(将{PORT}替换为您要重定向的端口): RewriteEngine On

RewriteCond %{SERVER_PORT} ^{PORT}$

RewriteRule ^(.*)$ http://www.redirect.com [L, R=301]

如果端口不是80,则将.htaccess重定向部分拉回到错误页面 This will allow you to redirect based on the incoming p

...

我想确保数据发送方是域A而不是其他 无法可靠地检测请求是否由在特定域上托管的页面中运行的JavaScript触发。 使用cookie和访问令牌让我更加困惑 这是一种间接方法。 从本质上讲,这个过程可以像这样工作: 两个服务器中的一个生成访问令牌(以及到期时间) 它将该令牌发送到另一台服务器 托管应用程序的服务器将该令牌发送到客户端 客户端向托管数据的服务器发出请求,并在URI中包含该令牌 托管数据的服务器识别令牌并授权客户端(可能设置cookie以便令牌自动保留) 令牌仍然可以从应用程序中提取,因

...

您是否尝试在htaccess文件中使用If / Else指令来严格访问主机。

Redirect (.*) http://www.example.com

# Require all denied

更多细节在这里解释 Did you try using the If/Else directives in the htaccess file to strict access by h

...

如GRANT语法中所述 : 帐户名称和密码 [ deletia ] 您可以在主机名中指定通配符。 例如, user_name @'%.example.com'适用于example.com域中任何主机的user_name @'192.168.1.%' , user_name @'192.168.1.%'适用于192.168.1 C类子网中任何主机的user_name 。 As documented under GRANT Syntax: Account Names and Passwords [ d

...

虽然限制ADFS 2.0在特定OU下工作是不可行的(从我阅读的资源和IMHO),我们可以限制特定OU中的用户访问。 这可以通过两个步骤完成: 添加声明规则以提取AD对象DN。 •要从ADFS管理控制台中提取此声明,请转至ADFS 2.0 - >信任关系 - >声明提供程序信任 - >单击Active Directory - >编辑声明规则。 •在接受转换规则下,添加新规则 Claim rule name – DN (can be anything)

LDAP Attri

...

grant select on table to username

grant select on table to username

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值