MySQL Variables ignore_db_dirs 数据库 参数变量解释及正确配置使用
本站中文解释
ignore_db_dirs参数用于在查询MySQL数据库时忽略指定文件夹,默认情况下只对表、列和行进行检索识别操作,此参数可以指定那些目录应该在查询中被忽略。设置方法如下:
第一步:首先进入MySQL命令行模式,输入“mysql -u root -p” 登录到MySQL数据库。
第二步:执行以下SQL语句,将ignore_db_dirs变量设置为指定的文件夹:
SET GLOBAL ignore_db_dirs = “文件夹1,文件夹2,文件夹3,……”;
第三步:该变量设置只在当前MySQL会话有效,因此在结束当前SQL会话后,需要将该变量设置添加到MySQL配置文件中,以确保每次重新启动MySQL时都会应用该变量的取值。
第四步:将 SET GLOBAL语句添加到MySQL配置文件(通常为/etc/my.cnf)并保存:
ignore_db_dirs=”文件夹1,文件夹2,文件夹3,……”
最后:重启MySQL服务器以使参数变量生效。
官方英文解释
ignore_db_dirs
Deprecated | 5.7.16 |
---|---|
System Variable | ignore_db_dirs |
Scope | Global |
Dynamic | No |
Type | String |
A comma-separated list of names that are not considered as
database directories in the data directory. The value is set
from any instances of
--ignore-db-dir
given at server
startup.
As of MySQL 5.7.11,
--ignore-db-dir
can be used at
data directory initialization time with mysqld
–initialize to specify directories that the server
should ignore for purposes of assessing whether an existing
data directory is considered empty. See
Section 2.9.1, “Initializing the Data Directory”.
This system variable is deprecated in MySQL 5.7.
With the introduction of the data dictionary in MySQL
8.0, it became superfluous and was removed in that
version.