30.9.1 限制用户使用资源示例

本文展示了如何限制用户binghe_test在goods数据库上的权限,包括每小时100次查询、20次更新的限制,以及最大10个并发连接的设定。通过SQL语句配置后,可以查看到用户的具体资源使用限制。

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

30.9.1 限制用户使用资源示例

例如,为binghe_test用户授予goods数据库上的查询和更新权限,并且每小时的查询次数最多为100,每小时的更新次数最多为20,使用binghe_test用户最多同时有10个并发连接。


mysql> GRANT SELECT, UPDATE ON goods.* TO 'binghe_test'@'localhost'
    -> WITH MAX_QUERIES_PER_HOUR 100
    -> MAX_UPDATES_PER_HOUR 20
    -> MAX_USER_CONNECTIONS 10;
Query OK, 0 rows affected, 1 warning (0.00 sec)

SQL语句执行成功,查看binghe_test用户的资源限制情况。


mysql> SELECT user, host, max_questions, max_updates, max_user_connections
    -> FROM mysql.user WHERE user = 'binghe_test' AND host = 'localhost';
+-------------+-----------+---------------+-------------+----------------------+
| user        | host      | max
INFO | Android emulator version 35.4.9.0 (build_id 13025442) (CL:N/A) INFO | Graphics backend: gfxstream INFO | Found systemPath E:\Android\SDK\system-images\android-36\google_apis_playstore\x86_64\ WARNING | Please update the emulator to one that supports the feature(s): VulkanVirtualQueue INFO | IPv4 server found: 192.168.123.1 INFO | Ignore IPv6 address: 70:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 70:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 70:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: f075:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: f075:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: f075:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 8083:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 8083:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 8083:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: e08b:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: e08b:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: e08b:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 5094:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 5094:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 5094:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 489a:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 489a:8c00:5d02:0:70:8c00:5d02:0 INFO | Ignore IPv6 address: 489a:8c00:5d02:0:70:8c00:5d02:0 INFO | Checking system compatibility: INFO | Checking: hasCompatibleHypervisor INFO | Ok: Hypervisor compatibility to run avd: `Medium_Phone_API_36` are met INFO | Checking: hasSufficientSystem INFO | Ok: System requirements to run avd: `Medium_Phone_API_36` are met INFO | Checking: hasSufficientHwGpu INFO | Ok: Hardware GPU requirements to run avd: `Medium_Phone_API_36` are passed INFO | Checking: hasSufficientDiskSpace INFO | Ok: Disk space requirements to run avd: `Medium_Phone_API_36` are met ERROR | Running multiple emulators with the same AVD ERROR | is an experimental feature. ERR
最新发布
03-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值