2

I am trying to run a PHP website (Prestashop 1.4) locally using XAMPP. I copied all the data from public_html and put it in htdocs.

When I tried to use phpmyadmin to import the database, it said that the file was too large. I went to the ini file and changed

myisam_sort_buffer_size = 8M

to

myisam_sort_buffer_size = 1500M

I tried to import the file again, and it said :

You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit.

Is there another way to bypass that limit? Thanks in advance.

BenRoob
  • 1,662
  • 5
  • 22
  • 24
Morgoth
  • 47
  • 1
  • 2
  • 7
  • 2
    Do you import/upload your file via PHP? If so, please check https://stackoverflow.com/questions/1700207/upload-large-files-using-php-apache and adjust your php.ini settings to your needs. – BenRoob Sep 11 '17 at 11:43
  • No, the files are local to my computer. I did those edits and it still says it's too large. – Morgoth Sep 11 '17 at 11:52
  • phpmyadmin sucks, and I believe has a 50MB limit on that kind of thing. Download HeidiSQL and import from that. – delboy1978uk Sep 11 '17 at 11:53
  • 1
    @delboy1978uk if anything sucks here, it's your understanding how things work. There's no 50MB hard limit. – Marcin Orlowski Sep 11 '17 at 11:55
  • @Morgoth If you upload the files via phpmyadmin, then a script of phpmyadmin is probably executed ;) – BenRoob Sep 11 '17 at 11:56
  • 1
    Possible duplicate of [Can't import database through phpmyadmin file size too large](https://stackoverflow.com/questions/9593128/cant-import-database-through-phpmyadmin-file-size-too-large) – Marcin Orlowski Sep 11 '17 at 11:56
  • @delboy1978uk Sorry for being a noob, but wouldn't that mess around with everything else on XAMPP? Or is it just a php administration tool..I want to do what you're saying though. – Morgoth Sep 11 '17 at 11:57
  • It's just a website that connects to your MySQL. You can use any tool, it won't affect anything. – delboy1978uk Sep 11 '17 at 11:59
  • I don't understand what is happening. I made the limit 1,5GB, it even shows in the little upload bar. Now I get this error when I try to upload a database of 19MB. https://imgur.com/a/EEt5V – Morgoth Sep 12 '17 at 10:23
  • OK I managed to find the problem while browsing a prestashop forum thread from 2010. I re-exported the SQL file from the original store, this time checked the box next to "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION" under "structure". The importing worked. Thanks all for your suggestions – Morgoth Sep 13 '17 at 11:23
  • This works for me when I need to import a large sql file. `mysql -u root -p; source /directory/where/file/exists/file.sql;` – SaundersB Aug 02 '18 at 17:35

1 Answers1

5

If you are using MySQL in Xampp then do the steps below.
Find the following in php.ini file

post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

And change their sizes according to your need. I'm using these values

post_max_size = 30M
upload_max_filesize = 30M
max_execution_time = 4500
max_input_time = 4500
memory_limit = 850M

Note:1 upload_max_filesize is essential But it's better to change all.

Note:2 You must restart apache service.

M.A.K. Ripon
  • 2,070
  • 3
  • 29
  • 47