代码:
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
没有变化。