使用一个命令授予多个数据库 [英] grant to multiple db using one command
本文介绍了使用一个命令授予多个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有许多具有相同前缀的mariaDB
数据库.如
I have many mariaDB
databases that has same prefix. Such as
apple1
apple2
apple3
....
apple5000
apple5001
banana1
banana2
...
banana100
我想创建一个新用户USER
,该用户可以SELECT
数据库具有apple
前缀.
因此,我使用下面的多个命令将SELECT
授予新用户USER
.
And I want create new user USER
who can SELECT
databases has apple
prefix.
So I grant SELECT
to new user USER
using multiple command below to.
GRANT SELECT ON `apple1` TO 'USER'@'%';
GRANT SELECT ON `apple2` TO 'USER'@'%';
GRANT SELECT ON `apple3` TO 'USER'@'%';
...
GRANT SELECT ON `apple5001` TO 'USER'@'%';
是否有对多个数据库的任何解决方案授权都使用一个命令(例如,LIKE
语句的通配符(%
))指定了前缀?
Is there any solution grant to multiple databases has specify prefix using one command like wildcard(%
) of LIKE
statement?
推荐答案
GRANT SELECT ON `apple%`.* TO 'USER'@'192.168.0.227';
这篇关于使用一个命令授予多个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文