0

Using IIS 10, msql 8, php 8.1, phypmyadmin 5.2

Database uploads does not work as per subject. On this sever are Wordpress sites and upload works.

Database size does not seem to be the issue as I tried to upload a 170KB sql file. PHP is setup to allow 100MB.

ERROR on import:

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

I spent far too long trying to resolve this.

Any ideas? Thank you.

I tried different database files and sizes. Upload simply does not work.

RogerV
  • 1

1 Answers1

0

Turns out it was caused by the temporary directory PHP uses for uploads. By default this is C:\Windows\Temp, which is not writable for PHP.

In php.ini, add:

upload_tmp_dir = C:\inetpub\temp

Make sure to remove any other upload_tmp_dir settings. Set permissions on C:\inetpub\temp so IUSR and IIS_IUSRS have write permission. Restart IIS and you should be fine. Similar case: https://stackoverflow.com/a/15568928/20058276.

Update

One of the possible reasons is file name was not specified or was invalid. Since you tried different database files. This reason can be ruled out.

Then the temporary directory for uploading files is not writable by PHP. Like I mentioned above.

Finally, there is the file size exceeded the upload limit of PHP or phpMyAdmin. PHP is setup to allow 100MB. Please show the relevant code in php.ini. Because post_max_size upload_max_filesize max_execution_time max_input_time and memory_limit all need to be set. And the service must be restarted after setting.

Or upload large size database using MySQL Console: https://stackoverflow.com/a/22343190/20058276

So you need to test separately to find the real cause. Feel free to share if you have any doubts. Community members will be happy to help you.

TengFeiXie
  • 176
  • 5
  • Hello. I indicated WordPress sites can upload properly. That means PHP has write access to uploads folder. I have permissions set correctly on the folder. – RogerV Apr 17 '23 at 15:50
  • Here are the php.ini settings post_max_size = 256M upload_max_filesize = 100M max_execution_time=300 max_input_time = 300 memory_limit = 256M – RogerV May 03 '23 at 20:07
  • You can increase these parameters appropriately to test whether it works. If the possible causes of this error have been checked, I suggest you update your phpmyadmin version. – TengFeiXie May 04 '23 at 07:31
  • Considering wordpress uploads large files without issue. I do not think these php settings are the issue. As originally indicated, the latest phpmyadmin is being used. – RogerV May 05 '23 at 15:24
  • Since there is no problem with folder permissions and php.ini. That can only be a problem with the SQL file, the file name or the format. I don't think it's a problem with the SQL file. Possible reasons are these. As community members have discussed, it may not work for everyone. Perhaps you should try to upload large size database by MySQL Console. – TengFeiXie May 08 '23 at 08:57
  • As mentioned, I tried a few different sql files including a 170KB sql file. All produce the same error. Thank you. – RogerV May 09 '23 at 13:35