![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
[SOLVED]: How to insert 30-50K rows into MySQL DB using DBI?by Perl300 (Friar) |
on Oct 02, 2018 at 21:57 UTC ( #1223430=perlquestion: print w/replies, xml ) | Need Help?? |
Perl300 has asked for the wisdom of the Perl Monks concerning the following question: Greetings monks! I am trying to insert around 30-50K rows using DBI into a MySQL DB (5.5.56-MariaDB). I am trying to use following code (say insert1.pl) which is working for almost 6-7K rows.
But when I try to insert all the rows, which at present are 27K, I see error in log like:
I have tried to add option for AutoCommit and auto_reconnect as I got those as suggetions while searching for reason behind the error MySQL server has gone away at I did try to super search here for 'bulk insert', 'mysql bulk' & 'DBI insert' but didn't get what I am looking for. I also tried use diagnostics but it adds only one line in the error: Uncaught exception from user code: Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle database=telemetry:host=<IP> at insert1.pl line 38. I am pretty sure that there is better way to do this than how I am doing it here. UPDATE_1:Added note after trying use diagnostics. UPDATE_2:The 'Root (root@localhost) (configure /etc/snmp/snmp.local.conf)' is coming from data. So that is not the problem here. UPDATE_3: Updated title to mark it as SOLVED.
Back to
Seekers of Perl Wisdom
|
|