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

本站中文解释

session_track_schema参数是MySQL的一个系统变量,它用于控制服务器是否跟踪当前活动使用非默认架构的情况。

此参数可设置为ON或OFF,表示MySQL服务器是否会跟踪当前活动使用的数据库架构名称。 如果启用了此选项,则会更新MySQL服务器管理的内部状态变量current_schema,以指示当前连接正在使用的架构名称。 在此之前,MySQL服务器不会跟踪当前活动数据库架构名称,并且current_schema变量将为NULL。

设置session_track_schema参数的方法如下:

1.使用SET语句

使用SET语句可以在会话级别设置该参数,如下所示:

SET session_track_schema = ON; //设置参数为ON

2.使用SET GLOBAL语句

SET GLOBAL语句可以在服务器级别设置该参数,如下所示:

SET GLOBAL session_track_schema = ON; //设置参数为ON

官方英文解释

session_track_schema

Command-Line Format --session-track-schema[={OFF|ON}]
System Variable session_track_schema
Scope Global, Session
Dynamic Yes
Type Boolean
Default Value ON

Controls whether the server tracks when the default schema
(database) is set within the current session and notifies the
client to make the schema name available.

If the schema name tracker is enabled, name notification
occurs each time the default schema is set, even if the new
schema name is the same as the old.

For more information about session state tracking, see
Section 5.1.15, “Server Tracking of Client Session State”.


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