Open-MySqlConnection : Couldn't connect to server
For the latest instalment/version, I'm getting this Open-MySqlConnection : Couldn't connect to server error without further hints.
I checked get-help Open-MySqlConnection but didn't find more insightful options. Removing -WarningAction SilentlyContinue would not give more info either.
PS C:\> $sqlConnect = Open-MySqlConnection -ConnectionName MyDBCon -Server $DBServer -Database $DBName -Port 3306 -Credential $creds -WarningAction SilentlyContinue
Open-MySqlConnection : Couldn't connect to server
At line:1 char:15
+ ... qlConnect = Open-MySqlConnection -ConnectionName MyDBCon -Server $DBS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (MyDBCon:String) [Open-MySqlConnection], MySqlException
+ FullyQualifiedErrorId : OpenMySQLConnection.Error,SimplySql.Cmdlets.OpenMySqlConnection
PS C:\> $sqlConnect = Open-MySqlConnection -Server $DBServer -Database $DBName -Port 3306 -Credential $creds
Open-MySqlConnection : Couldn't connect to server
At line:1 char:15
+ ... qlConnect = Open-MySqlConnection -Server $DBServer -Database $DBName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (default:String) [Open-MySqlConnection], MySqlException
+ FullyQualifiedErrorId : OpenMySQLConnection.Error,SimplySql.Cmdlets.OpenMySqlConnection
PS C:\> Test-NetConnection $DBServer -port 3306
ComputerName : ....net
RemoteAddress : ...
RemotePort : 3306
InterfaceAlias : Ethernet0
SourceAddress : ...
TcpTestSucceeded : True
PS C:\> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.17763.5933
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.5933
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Local connection with the above parameters works fine.
Any ways I can further troubleshoot this (like -SSLMode etc) please? thx
Do not run that file! It is malware. The account has been spamming links to it all over GitHub. They use a password protected zip archive to evade the auto-check by MediaFire. I extracted it on a non-Windows machine and checked it manually. 17 positives.
@suntong I have no idea who that is, i've deleted their comment. @thelabcat --thanks for the heads up.
@suntong as for your issue -- to get more details, run
# you may want to clear errors first -- $error.Clear(), then run your code, then run the below
$Error | Select-Object *
@suntong -- did you get any farther?
Oh, sorry, didn't get around doing that. Let me close it for now.