Closed Myjestic closed 8 months ago
@Myjestic -- interesting suggestion -- version 1.9 does not support PowerShell 7 yet (so if it works, great.. if not...)... I'm almost finished with 2.0 which is a complete rewrite to fully support PowerShell 7 (and cross platform). 2.0 will also switch the underlying provider for MySql, which may improve this experience (and avoid the need for additional connection parameter). However, if it doesn't, 2.0 also support providing arbitrary additional connection parameters without having to construct the connection string manually, so that would also solve for this particular scenario.
I try to avoid putting things into the connection string that might be situation specific.
Running on Debian with pwsh7. If I connect with
Open-MySqlConnection -server $dbHost -connectionname 'localhost' -database $dbName -UserName $dbUser -Password $dbPass
and execute a query, the following error occures because of wrong date values in my database.I was able to solve the issue by connecting like this:
Open-MySqlConnection -ConnectionName 'localhost' -ConnectionString "convert zero datetime=true;server=localhost;Database=mydatabase;Uid=myuser;Pwd=mypassword;CHARSET=utf8"
Maybe you could implement "convert zero datetime=true" in your routine.