DBExport stuck after working OK for a few minutes

Forum Home Forums Understanding the Software DBExport stuck after working OK for a few minutes

This topic contains 6 replies, has 2 voices, and was last updated by Mikhail Mikhail 1 week, 2 days ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4707

    bencyau
    Participant

    Hello,

    I am observing strange behavior in DBExport (MySQL8.0), that the data generated into the database seem to randomly start and stop.

    The system seemed to work OK with some inputs, then got stuck on one.

    The only input is the sample OPC channel 201. And the system seems to got stuck on this entry, and generated many of the same error message as below:

    2018-12-06 15:27:35 Error export current data to DB MySQL – localhost: Duplicate entry ‘2018-12-06 15:11:20-201’ for key ‘PRIMARY’

    Thanks.

    #4708
    Mikhail
    Mikhail
    Moderator

    Hi,

    I hope this advice will solve your issue.

    #4711

    bencyau
    Participant

    Hello,
    Before seeing Mikail’s suggestion, I got tired after trying MySQL8 on three different PC’s and got the same issue. So, I moved on to use PostgreSQL10.6, and which worked out perfectly without any complaints. Luckily these two are very similar in structure and Admin tools.
    Now the only problem is finding a good way to remove old data in Postgres since it does not yet have the MySQL events functionality.

    Thanks.

    #4712

    bencyau
    Participant

    https://dev.mysql.com/doc/refman/8.0/en/fractional-seconds.html

    OK. I went back and applied Mikhail’s answer, which is OK as workaround for MySQL8.

    The correct method is to follow the above link is MySQL8 doc on assigning fractional part to the time values. When I used the DATETIME(6) type the DBExport worked fine with 6 fractional values for the SECOND. Problem fixed.

    Of course, if you still encounter the duplicate Primary Key issue, apply Mikhail’s fix.

    #4713
    Mikhail
    Mikhail
    Moderator

    Hello,

    Now the only problem is finding a good way to remove old data in Postgres since it does not yet have the MySQL events functionality.

    Could you send a link to an example of MySQL events? How do you use events for removing old data?

    #4721

    bencyau
    Participant

    Hello Mikhail,

    Many posts available on google search, here is one that sums it up best:

    https://forums.mysql.com/read.php?10,288225,288225#msg-288225
    Note, that events are supported from MySQL 5.1.6.

    I plan to try it out today.

    #4723
    Mikhail
    Mikhail
    Moderator

    Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.