为什么你想要一个区分大小写的数据库?(Why would you want a case sensitive database?)
对不区分大小写的排序选择区分大小写的原因有哪些? 我可以看到DB引擎在进行字符串比较时可能会有适度的性能提升。 是吗? 如果您的数据设置为全部低或大写,那么区分大小写可能是合理的,但如果您存储混合大小写数据,然后尝试查询它,则会导致灾难。 您必须接着说在列上应用lower()函数,以便匹配相应的小写字符串文字。 这可以防止我使用的每个dbms中的索引使用情况。 所以想知道为什么有人会使用这样的选项。
What are some reasons for choosing a case sensitive collation over a case insensitive one? I can see perhaps a modest performance gain for the DB engine in doing string comparisons. Is that it? If your data is set to all lower or uppercase then case sensitive could be reasonable but it's a disaster if you store mixed case data and then try to query it. You have to then say apply a lower() function on the column so that it'll match the corresponding lower case string literal. This prevents index usage in every dbms that I've used. So wondering why anyone would use such an option.
原文:https://stackoverflow.com/questions/2986530
最满意答案
userAdminAnyDatabase的文档说( http://docs.mongodb.org/manual/reference/user-privileges/#userAdminAnyDatabase ):
但是, userAdminAnyDatabase和userAdmin不明确授权用户使用超出用户管理的任何特权。
您还必须为list databases命令添加“ clusterAdmin ”角色: http : //docs.mongodb.org/manual/reference/user-privileges/#clusterAdmin
如果您希望用户从数据库和集合中读取/写入,则需要添加另一个角色,即“ readWrite ”角色: http : //docs.mongodb.org/manual/reference/user-privileges/#readWrite
The documentation on userAdminAnyDatabase says (http://docs.mongodb.org/manual/reference/user-privileges/#userAdminAnyDatabase):
However, userAdminAnyDatabase and userAdmin do not explicitly authorize a user for any privileges beyond user administration.
You will also have to add the "clusterAdmin" role for the list databases command: http://docs.mongodb.org/manual/reference/user-privileges/#clusterAdmin
If you want you user to read/write from the database and collections, you will need to add another role, the "readWrite" role: http://docs.mongodb.org/manual/reference/user-privileges/#readWrite
相关问答
更多-
userAdminAnyDatabase的文档说( http://docs.mongodb.org/manual/reference/user-privileges/#userAdminAnyDatabase ): 但是, userAdminAnyDatabase和userAdmin不明确授权用户使用超出用户管理的任何特权。 您还必须为list databases命令添加“ clusterAdmin ”角色: http : //docs.mongodb.org/manual/reference/user-p ...
-
我用错误的命令更新角色这里是正确的: db.grantRolesToUser( "mongoadmin", [{ role: "read", db: "local"}]) 现在我可以查看replicainfo: rep0:PRIMARY> rs.printReplicationInfo() configured oplog size: 990MB log length start to end: 617347secs (171.49hrs) oplog first event time: Thu M ...
-
但这种方式没有。 行会更多。 数据库很好地管理了大量的行,数百万行不是问题。 有没有办法将标签存储在类似结构的数组中? 不不不 - 不要那样走。 这打破了数据库规范化规则,特别是第一个正常形式 : 第一范式(1NF)是关系数据库中关系的属性。 当且仅当每个属性的域仅包含原子(不可分割)值且每个属性的值仅包含来自该域的单个值时,关系才是第一范式。 这种方法(在一个列中存储许多值)乍一看似乎很有吸引力,但是有一天当有人要求你查询“给我所有有权访问TAB-233用户”时,你会陷入混乱。 这种方法的一些其他缺点: ...
-
在PostgreSQL 9.4文档中,它说:“CREATE USER现在是CREATE ROLE的别名,唯一的区别是当命令拼写为CREATE USER时,默认情况下为LOGIN,而命令拼写为CREATE ROLE时假定为NOLOGIN。 因此,关于CREATE ROLE和CREATE USER的问题转移到了有关LOGIN和NOLOGIN属性之间差异的问题,因为PostgreSQL只知道角色。 根据描述,LOGIN / NOLOGIN属性确定是否可以使用角色从客户端进行连接。 客户端可以是任何你的pgAdmi ...
-
如何创建一个在Woocommcers中表现得像客户角色的用户角色(How to create a User Role that behaves like customer role in Woocommcers)[2023-04-26]
您可以通过以下方式将客户角色功能添加到卖方角色 $wp_roles = wp_roles(); $customerRole = $wp_roles->get_role( 'customer' ); // Copy customer role capabilities $role = 'seller'; $display_name = 'Seller'; add_role( $role , $display_name , $customerRole->capabilities ); You ca ... -
看起来您正尝试在mono数据库上分配userAdminAnyDatabase角色,而不是{{admin}}数据库。 “anyDatabase”角色仅适用于对admin数据库进行身份验证的用户。 有关更多信息,请参阅anyDatabase角色的文档 。 It appears that you're attempting to allocate the userAdminAnyDatabase role on the mono database, not the the {{admin}} database. ...
-
流星与多个Mongo DBs(Meteor with multiple Mongo DBs)[2022-11-12]
好吧,我已经做到了......很久以前我还想在这里发布答案。 你需要的是这样的: dbCustomer = new MongoInternals.RemoteCollectionDriver( CUSTOMER_DB_URL + customerId ); 通过这种方式,您可以创建您在创建新集合时使用的自定义驱动程序: Products['procucts' + customerId] = new Meteor.Collection( 'products' + customerId, ... -
你没有。 如果您使用ASP.NET的成员资格框架,则不要使用LinqToSql来触摸它。 您使用ASP.NET的成员资格框架 。 You don't. If you're using ASP.NET's membership framework, you don't touch it using LinqToSql. You use ASP.NET's membership framework.
-
使用Grails中的spring安全性插件的默认设置,角色名称必须以前缀"ROLE_" ,因此将ADMIN_ROLE重命名为ROLE_ADMIN ,将USER_ROLE重命名为ROLE_USER 。 此论坛帖子解释了默认情况下它的工作原理,以及如何根据需要对其进行不同的配置。 With the default settings of the spring security plugin in Grails role names must start with the prefix "ROLE_", so r ...
-
正如@Craig解释的那样,你不能(即使你可以,它也是毫无意义的)。 实现受限超级用户权限的常用方法是作为现有超级用户角色进行连接,并创建包含一组有限批准命令的SECURITY DEFINER函数 。 现在将使用创建者而不是调用者的权限执行这些功能。 但是您需要非常小心,不要打开任何注入漏洞,因为函数中的所有内容都将以超级用户身份运行。 例如,调用者可以编写一个custom =运算符,授予他们超级用户权限,并将其放在搜索路径中,因此您需要绝对确保在pg_catalog模式中使用= 。 至少,你应该: 使用S ...