1

I have a 300MB CSV file and I need to import it to my localhost database. I have changed upload_max_filesize and post_max_size in php.ini.

The problem is that it is taking a very long time to complete the import.

I want to know how I can do it faster. It should not take this long.

jsanalytics
  • 13,058
  • 4
  • 22
  • 43
Don Donllei
  • 67
  • 1
  • 6

1 Answers1

2

Upload it to the server and use the command-line. This will reduce any inefficiencies created by having php, the web server, the web client, and the internet connection to you sitting on top of the actual import.

Importing a csv into mysql via command line

Community
  • 1
  • 1
Tom
  • 939
  • 5
  • 9
  • Alternatively, you could upload the file (through SFTP, SCP, etc) to a particular folder on your webserver and use the phpMyAdmin "UploadDir" directive to point to the file. But I do agree that the command line is the best solution when available. See http://docs.phpmyadmin.net/en/latest/config.html#cfg_UploadDir for details – Isaac Bennetch Jan 23 '16 at 14:58