Osi
Osi

Reputation: 1

“connection was reset” when importing a 20mb SQL file to MySQL via phpmyadmin in Nginx

On Ubuntu 16.04 with Bash I've established a LEMP env with PHP 7.0, MySQL 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper.

Nginx conf

PHP conf

/etc/php/7.0/fpm/zz_overrides.ini:

zz_overrides.ini

[PHP]
post_max_size = 2000M
upload_max_filesize = 2000M
max_execution_time = 3000
cgi.fix_pathinfo=0

Enabled this way:

ln -s /etc/php/*/fpm/zz_overrides.ini 20-overrides.ini

Resetting everything:

chown -R www-data:www-data "$drt"/
chmod -R a-x,a=rX,u+w "$drt"/
systemctl restart nginx.service
/etc/init.d/php*-fpm restart

Current state

I get "connection was reset" when importing a 20mb SQL file to MySQL via phpmyadmin in Nginx.

Error in Nginx error log:

2018/03/06 02:37:38 [error] 5623#5623: *42 client intended to send too large body: 21683799 bytes, client: 79.178.117.194, server: _, request: "POST /phpmyadmin/import.php HTTP/1.1", host: "159.65.94.190"

Desired state

Upload went successfully.

My question

Given I changed my maximum upload amount to 2000mb (and PHPmyadmin seems to recognize this by the way), why does my quite small, 20mb sql file fails to upload with that error?

Upvotes: 2

Views: 1524

Answers (1)

nikhil bhat
nikhil bhat

Reputation: 36

You will have to increase the client_max_body_size directive.

refer to this question `s answer

How to edit nginx.conf to increase file size upload

Upvotes: 2

Related Questions