无法使用Powershell代码禁用SQL_SAFE_UPDATES

时间:2018-12-09 19:33:37

标签: powershell amazon-rds aws-powershell

代码:

Import-Module "C:\\Program Files (x86)\\AWS Tools\\PowerShell\\AWSPowerShell\\AWSPowerShell.psd1"
[void][System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")
$connection = New-Object MySql.Data.MySqlClient.MySqlConnection
$connection.ConnectionString = "SERVER=$server_name;PORT=$port;Database=$db;UID=$uname;PWD=$pwd"
$connection.Open()
$query2   = "SET SQL_SAFE_UPDATES = 0;"
$command1 = New-Object MySql.Data.MySqlClient.MySqlCommand($query2, $connection)

查询已成功执行,但是变量SQL_SAFE_UPDATES没有变化。

0 个答案:

没有答案