我已经用这个命令创建了一个用户
CREATE USER 'bean'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON databaseA.* to 'bean'@'localhost';
但是,当我以 bean
身份登录时,我能够使用 information_schema
和 test
数据库。根据我的理解,bean
不应该只能看到 databaseA
吗?
我也尝试运行 use information_schema
显然没有什么能阻止 bean
这样做。
那么,每个用户都可以访问 information_schema 和 test 吗?
仅供引用,root
用户带有这些默认表:information_schema、mysql、test。是的,bean
看不到 mysql,这让我觉得也许每个用户都可以访问这些表。
有没有办法让 bean
只能访问 databaseA
,而不能访问其他的?
最佳答案
我有同样的问题在phpMyAdmin的配置文件(config.inc.php)中,可以添加:
$cfg['Servers'][$i]['hide_db'] = 'information_schema';
这将隐藏该数据库...
关于mysql - Information_schema 是否对 MariaDB 中的 everuser 可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7847803/