如何阻止用户访问特定模式?
我有一个为我创建的服务器。 其上有一个名为“测试”的模式。
我已使用 root 用户登录,并创建了一个名为“WEB”的新架构。
create schema WEB;
我现在想做的是让一个用户只能看到新的模式。
所以我创建了一个像这样的用户:
create user webtestuser identified by 'webtestuser';
grant select, insert, update, delete on WEB.* to webtestuser;
问题是,当我使用新用户登录时,我仍然可以看到“test”模式。即使当我“撤销所有”用户时,该模式仍然可见。
我这里缺少什么吗?
谢谢 !
I have a server, that was created for me.
On it there is a schema called "test".
I've logged in with root user, and created a new schema called "WEB".
create schema WEB;
What I want to do now, is to have a user, that can only see that new schema.
So I created a user like so:
create user webtestuser identified by 'webtestuser';
grant select, insert, update, delete on WEB.* to webtestuser;
The problem is that when I log in with the new user, I can still see the "test" schema. Even when I 'revoke all' on the user, that schema is still visable.
Anything I'm missing here?
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,mysql 附带了一些针对定义的测试模式的授权。它们对所有用户都是
ALL ON test
,对所有用户也是ALL ON test\_%
(test\_%
与诸如>test_foo
,test_123
)由于它们的定义方式,我看不到使用
REVOKE ... FROM
语法删除这些授权的方法所以你必须使用以下内容:By default mysql comes shipped with some grants foro the test schemas defined. They are
ALL ON test
to all users and alsoALL ON test\_%
to all users (test\_%
matches stuff liketest_foo
,test_123
)Because of the way they're defined I can't see a way of removing these grants using the
REVOKE ... FROM
syntax so you'll have to use the following: