-2

Because When I upload above 2mb size of image in node js using mysql

"not upload throw some issues"

"Got a packet bigger than 'max_allowed_packet' bytes"

I am using npm module multer for file upload. My code for upload image is as follows:

Manimaran
  • 405
  • 2
  • 8
  • 20
  • Possible duplicate of [MySQL Error 1153 - Got a packet bigger than 'max\_allowed\_packet' bytes](https://stackoverflow.com/questions/93128/mysql-error-1153-got-a-packet-bigger-than-max-allowed-packet-bytes) – adiga Nov 22 '17 at 05:46
  • I would recommend you save your uploads as files rather than in your database. – jcaron Nov 22 '17 at 07:44

1 Answers1

0

You should modify in the my.ini or ~/.my.cnf file

max_allowed_packet=512M

You can insert this line under [mysqld] section.

After this change please Restart the mysql once. Thank you!

Deep Kakkar
  • 5,831
  • 4
  • 39
  • 75