0

I want to insert 30K records to my table. I have the .sql file for the same table and want to do with laravel seeder.

DB::disableQueryLog();
DB::unprepared(file_get_contents('database/seeds/sql/inv_diagnostic_fe.sql'));

Its only inserting 338 rows. what happening after the insertion of 338 ? How can I fix this issue ?

Jishad
  • 2,876
  • 8
  • 33
  • 62
  • Do you have an error message? – macghriogair Dec 08 '16 at 10:26
  • no error messages. seeding was completed. but only 338 rows are inserted. – Jishad Dec 08 '16 at 10:27
  • Maybe you are running out of memory? Can u give the size of your sql file? There is a similar issue at https://stackoverflow.com/questions/25906199/laravel-seeding-large-sql-file and it recommends to use the plain mysql command or to split the file in separate statements. – macghriogair Dec 08 '16 at 10:29
  • the seeder file size is 444KB – Jishad Dec 08 '16 at 10:31
  • 1
    Have you tried to do a raw import through mysql and does it give the expected result? Just to make sure there is no mysql issue within the dump itself. – macghriogair Dec 08 '16 at 10:45

0 Answers0