-
Notifications
You must be signed in to change notification settings - Fork 29
SimplySQL within PowerShell Universal #148
Hi,
Did anyone get this to work with PowerShell Universal?
I'm trying to connect to an MySQL database using the local PowerShell 7.3.8 environment from the windows host.
The command I use (which works when i execute it in the local PS7 shell):
Open-MySqlConnection -Server "myserver" -ConnectionName "myconnection" -Database "mydb" -Credential $mycred -Port 3312
The Error i get (in PowerShell Universal):
[error] The type initializer for 'MySqlConnector.Core.ServerSession' threw an exception.
All reactions
Hi again!
The issue can be solved by switching the PSU environment from ‚PS7‘ to ‚Integrated‘.
I don't have a detailed explanation, but it works now and I can continue with the development of my PSU app! Thanks for the great support!
Replies: 1 comment 9 replies
@bononundelaine -- can you provide more error details? can you confirm which version of PS that PowerShell Universal is using? Can you confirm if other providers are working? (try the SQLIte provider -- its self-contained). Thanks
All reactions
@bononundelaine -- this suggests there might be an issue with PowerShellUniversal -- I would report the issue to them. Especially since running your script in native PowerShell works fine.
All reactions
I downloaded PowerShellUniversal -- and I'm getting the same error you are, but I'm not getting it for the other providers... this suggests something about that the MySQLConnector nuget package is conflicting with the PowerShell Runspace that PowerShellUniversal is using.
All reactions
@bononundelaine -- look at this response from the PowerShell Universal forums:
https://forums.ironmansoftware.com/t/issue-with-powershell-module-simplysql/10669/3
They suggest using a minimal environment and see if that makes things work.
All reactions
Hi again!
The issue can be solved by switching the PSU environment from ‚PS7‘ to ‚Integrated‘.
I don't have a detailed explanation, but it works now and I can continue with the development of my PSU app! Thanks for the great support!