Forum Home › Forums › Understanding the Software › DBExport stuck after working OK for a few minutes
Tagged: DBEXPORT, MySQL8, PostgreSQL
- This topic has 6 replies, 2 voices, and was last updated 6 years, 11 months ago by
Mikhail.
-
AuthorPosts
-
December 6, 2018 at 7:34 am #4707
bencyau
ParticipantHello,
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.
December 6, 2018 at 1:01 pm #4708
MikhailModeratorHi,
I hope this advice will solve your issue.
December 7, 2018 at 8:03 am #4711bencyau
ParticipantHello,
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.
December 7, 2018 at 11:34 am #4712bencyau
Participanthttps://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.
December 7, 2018 at 1:06 pm #4713
MikhailModeratorHello,
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?
December 9, 2018 at 3:48 am #4721bencyau
ParticipantHello 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.
December 9, 2018 at 2:44 pm #4723
MikhailModeratorThanks.
-
AuthorPosts
- You must be logged in to reply to this topic.