MySQL Variables skip_show_database 数据库 参数变量解释及正确配置使用

本站中文解释

skip_show_database是MySQL的参数变量,它的作用是禁止用 SHOW TABLES 命令显示数据库信息。

设置方式: ()

使用MySQL的命令行客户端:

mysql> SET GLOBAL skip_show_database = ON;

使用SQL语句:

mysql> UPDATE mysql.global_variables SET Value = ‘ON’ WHERE Variable_Name = ‘skip_show_database’;

使用MySQL配置文件:在MySQL配置文件中,可以使用下面的参数来控制skip_show_database:

skip-show-database

在MySQL配置文件中可以通过设置skip-show-database参数为1或ON来开启此功能。

官方英文解释

skip_show_database

Command-Line Format --skip-show-database
System Variable skip_show_database
Scope Global
Dynamic No
Type Boolean
Default Value OFF

This prevents people from using the SHOW
DATABASES
statement if they do not have the
SHOW DATABASES privilege. This
can improve security if you have concerns about users being
able to see databases belonging to other users. Its effect
depends on the SHOW DATABASES
privilege: If the variable value is ON, the
SHOW DATABASES statement is
permitted only to users who have the SHOW
DATABASES
privilege, and the statement displays all
database names. If the value is OFF,
SHOW DATABASES is permitted to
all users, but displays the names of only those databases for
which the user has the SHOW
DATABASES
or other privilege.

Caution

Because a global privilege is considered a privilege for all
databases, any global privilege enables
a user to see all database names with
SHOW DATABASES or by
examining the INFORMATION_SCHEMA
SCHEMATA table.


数据运维技术 » MySQL Variables skip_show_database 数据库 参数变量解释及正确配置使用