For example, in a log file, I have to collect events in a particular time and I have to store them in the database. How can I do that? The log file looks this:


Log file 1:

12/12/12 1:20:00.000 Start

12/12/12 1:20:00.000 Initialize

12/12/12 1:21:00.989 Stop

Log file 2:

12/12/12 1:20:00.000 Transmit

12/12/12 1:20:00.000 Hello

12/12/12 1:20:00.099 Receive

12/12/12 1:21:00.989 Bye

If I want the events during 12/12/12 1:20:00.000, I have more than one entry.How can I insert them into the database???

  • What does the log file look like? – systemovich Sep 21 '16 at 8:10

You need to create a separate key, unrelated to the timestamp, when inserting the rows into a table. MySQL has a handy auto increment feature for this purpose.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.