10
votes

I can't seem to get PHPMYADMIN to import an SQL file properly as it is giving my the error:

No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.

The documentation says:

The first things to check (or ask your host provider to check) are the values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. One user also said that post_max_size and memory_limit need to be larger than upload_max_filesize.

Here's what I've done...

Changed PHP.INI params

  • upload_max_filesize = 1000M
  • memory_limit = 1500M
  • post_max_size = 1500M
  • restarted Apache

I also tried different limit variables in hopes that maybe I was setting them too high... but that didn't matter. PHPMYADMIN confirms (on the import page) that the upload variable is set to "(Max: 1,000MiB)" but still no good. I am only trying to upload a file that is 5MB in size.

Any help would be much appreciated!

4
What does the Apache error log say, if anything? Are you using SSL client certificates?Basic
I know it's not really an answer, but do have access to the Command-line interface? You can probably use that to import the file, if you have access.rael_kid
did you try to zip the file and upload it.?Lalith B
I gave up on PHPMyAdmin and went back to old school - I used CLI.. #: mysql -u root {database} < file.sqlDan Gibson

4 Answers

15
votes

I've just fixed this on my own dev machine. In /etc/phpmyadmin/apache.conf you can see where phpmyadmin is trying to store temp files, e.g.:

php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp

Make sure this is writable by the user that apache runs as and has free space.

In my case, on my dev machine, I run apache as my own user rather than the normal www-data or apache user. That tmp dir wasn't writable by my user.

1
votes

For others with this problem not solved with PHP .ini settings, look in your html form:

<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />

My form had a value lower than my php server settings.

1
votes

I faced this problem on Ubuntu 17, maybe because of the upgrade I've done. The problem was a not writable /var/lib/phpmyadmin/tmp so just run this code:

sudo chmod 777 /var/lib/phpmyadmin/tmp/

and then its works again.

0
votes

Add "/tmp/" in open_base_dir directive in /etc/php/7.2/apache2/php.ini