3

I tried to import data into MySQL table using phpmyadmin for a file only 11 k. I got following message and increase upload_max_filesize, memory_limit and post_max_size , but it still does not work.

it works on my Ubuntu machine, but no Windows machines. Are there any way to see if IIS limit the file upload or something else I can check or configure?

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

user3528144
  • 131
  • 1
  • 1
  • 3

4 Answers4

5

I am on Ubuntu 14.10 and had a similar problem. I solved it in 2 steps but it is probable solvable in one.

If you change the config.inc.php file in /etc/phpmyadmin then you will be able to have access to an upload directory of your own choice. The files will not show up under the option "Select from the web server upload directory", however. To do that you have to change the apache.conf file in the folder /etc/phpmyadmin and add your folder to the value "php_admin_value open_basedir".

On my computer it was previously:

php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/

Afterwards it read:

php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/home/user/dumps/phpmyadmin/uploaddir

This will get the file to show up under the "web server directory" option. However, if you attempt to upload the file you will probably find the error "Uploaded file cannot be moved, because the server has open_basedir enabled without access to the /var/lib/phpmyadmin/tmp directory (for temporary files).

To fix that you have to fix permissions for the directory in question, which you do with:

  • sudo chmod 777 tmp/

After making that change you will be able to upload the file in any way you want.

In other words the solution to the problem - assuming you have already allowed PHP to handle large sizes, as I had - is to make sure that you grant all permissions to the /var/lib/phpmyadmin/tmp directory.

Thanks to Ashwin BG Ranore on the thread phpMyAdmin "The directory you set for upload work cannot be reached" for making it known that one has to change php_admin_value open_basedir if one wants to have an uploadDir of one's choice.

The original poster's problem was on a Windows computer so this solution will not help him, but will help those with a similar problem on Linux computers.

Community
  • 1
  • 1
DevKingKev
  • 51
  • 1
  • 3
0

I've seen a similar problem trying to restore small backups under phpmyadmin, which turned out to be a file encoding problem.

I've solved this before by opening the backup file in Notepad++, then under the Encoding menu selecting 'Convert to UTF-8', and re-saving. phpmyadmin then happily accepted the backup file without any other changes made.

Marty
  • 218
  • 2
  • 10
0

If you are using windows then check which tool you are using (Xampp/Wampp)

  1. using Wampp you can found php.ini file in below path
    C:\wamp64\bin\php\php8.1.0\php.ini

for Wampp file path also depends on which version of php you are using.

  1. Using Xampp

find location of config file, most of case you can found file in below path C:\xampp\php\php.ini

open php.ini file and configure it

upload_max_filesize=

memory_limit=

post_max_size

then restart your MySQL and apache.

0

Open a php.ini file. and Find upload_max_filesize text.

upload_max_filesize = 256M

Please read this tutorial: The maximum size permitted by your PHP configuration

Fefar Ravi
  • 794
  • 7
  • 18