我无法更改变量 "max_execution_time"
I can't change a variable "max_execution_time"
我将 max_execution_time
变量从 MySQL 更改为 60000,但是当我在 VBScript 中使用 ODBC 驱动程序进行查询时,结果仍然是默认值 30000。
用于更改变量值的查询:
SET max_execution_time = 60000;
SET GLOBAL max_execution_time = 60000;
SET SESSION max_execution_time = 60000;
在带有 ODBC 的 VBScript 中使用的查询:
show variables like '%max_execution%';
我期望输出60000,但实际输出是30000。
我在 Windows Server 2016 上使用 MySQL Server 5.7。
注意:这个问题只发生在ODBC上,因为我用PHP做了同样的测试,return值为60000。
有人知道那可能是什么吗?
更新:
这是我用作测试的脚本:
Dim strCon
strCon = "DRIVER = {MySQL ODBC 5.3 ANSI Driver}; SERVER = xxx.xxx.xxx.xxx; PORT = 3306; DATABASE = zadmin; USER = xxxx; PASSWORD = xxx; OPTION = 3; MULTI_STATEMENTS = 1;"
Dim oCon: Set oCon = WScript.CreateObject ("ADODB.Connection")
Dim oRs: Set oRs = WScript.CreateObject ("ADODB.Recordset")
oCon.Open strCon
Set oRs = oCon.Execute ("show variables like '% max_execution_time%';")
While Not oRs.EOF
WScript.Echo oRs.Fields (1) .Value
oRs.MoveNext
Wend
oCon.Close
Set oRs = Nothing
Set oCon = Nothing
我已经找到了这个案例的解决方案。
MySQL ODBC 驱动程序 5.3.6 或更高版本不会在 MySQL 服务器 5.7.4 或更高版本上吸收 'max_execution_time' 变量的配置。
我通过安装 MySQL ODBC 驱动程序 5.1 版解决了我的问题。
我将 max_execution_time
变量从 MySQL 更改为 60000,但是当我在 VBScript 中使用 ODBC 驱动程序进行查询时,结果仍然是默认值 30000。
用于更改变量值的查询:
SET max_execution_time = 60000;
SET GLOBAL max_execution_time = 60000;
SET SESSION max_execution_time = 60000;
在带有 ODBC 的 VBScript 中使用的查询:
show variables like '%max_execution%';
我期望输出60000,但实际输出是30000。
我在 Windows Server 2016 上使用 MySQL Server 5.7。
注意:这个问题只发生在ODBC上,因为我用PHP做了同样的测试,return值为60000。
有人知道那可能是什么吗?
更新:
这是我用作测试的脚本:
Dim strCon
strCon = "DRIVER = {MySQL ODBC 5.3 ANSI Driver}; SERVER = xxx.xxx.xxx.xxx; PORT = 3306; DATABASE = zadmin; USER = xxxx; PASSWORD = xxx; OPTION = 3; MULTI_STATEMENTS = 1;"
Dim oCon: Set oCon = WScript.CreateObject ("ADODB.Connection")
Dim oRs: Set oRs = WScript.CreateObject ("ADODB.Recordset")
oCon.Open strCon
Set oRs = oCon.Execute ("show variables like '% max_execution_time%';")
While Not oRs.EOF
WScript.Echo oRs.Fields (1) .Value
oRs.MoveNext
Wend
oCon.Close
Set oRs = Nothing
Set oCon = Nothing
我已经找到了这个案例的解决方案。 MySQL ODBC 驱动程序 5.3.6 或更高版本不会在 MySQL 服务器 5.7.4 或更高版本上吸收 'max_execution_time' 变量的配置。 我通过安装 MySQL ODBC 驱动程序 5.1 版解决了我的问题。