Skip to content

ZeroDate #1

Open
Open

Description

@steviecoaster

Hey! I found your awesome MySQL module via this link: https://mcpmag.com/articles/2016/03/02/querying-mysql-databases.aspx

One thing I ran into in my particular instance was the use of Zero Date Time. I had to modify the connection string in MySQL psm1 to include 'Convert Zero Datetime=True;' at the end of the string.

Just wanted to give you a heads up. It's a pretty easy MySQL bug to deal with, but in case you wanted to put that inside your module in some way, I thought I'd give you the heads up that others may find it useful as well.

Activity

  1. ysguy commented on Feb 19, 2020

    @ysguy

    Can you share the lines you changed in the script, its a pretty long file with a number of broken up query spots. Would save some troubleshooting. I am experiencing similar issues. My specific issue is

    argument(s): "Incorrect datetime value: '2/26/2020 5:00:00 AM' for column

    Seems that wasnt my issue, i fixed my problem with:
    (datetime).ToString('yyyy-MM-dd HH:MM:ss')

    But maybe you can post the change anyways?

  2. fablarosa commented on Aug 13, 2020

    @fablarosa

    Just edit C:\Program Files\WindowsPowerShell\Modules\MySQL\MySQL.psm1 so that the connection string is

    $connectionString = $connectionString + "default command timeout=$CommandTimeOut; Connection Timeout=$ConnectionTimeOut;Allow User Variables=True;Convert Zero Datetime=True"
    
  3. fablarosa commented on Jul 3, 2023

    @fablarosa

    Can someone please fix this issue in the source code for the next release?

    On the new version I changed line 141 of C:\Program Files\WindowsPowerShell\Modules\MySQL\public\Connect-MySqlServer.ps1 to

    $connectionString = $connectionString + "default command timeout=$CommandTimeOut; Connection Timeout=$ConnectionTimeOut;Allow User Variables=True;Convert Zero Datetime=True"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions