When I follow the example, Disconnect-MySqlServer -Connection $Connection, Invoke-MySqlQuery still works.