1

I am using below code for mysql connection and trying to upload a blob data in column.

require('dotenv').config()
var mysql = require('mysql');
var pool = mysql.createPool({
  host: process.env.MYSQL_HOST,
  user: process.env.MYSQL_USER,
  password: process.env.MYSQL_PASS,
  database: process.env.MYSQL_DB,
  connectionLimit: 10,
  supportBigNumbers: true
});

I am on localhost and has one database, with two projects setup, if I use project1 then no error is coming but if I use project2 then it is giving the error "Got a packet bigger than 'max_allowed_packet' bytes".

I am unable to bebug what is the problem with my project2 configuration.

Kunal
  • 603
  • 4
  • 13

1 Answers1

0

According to that answer: https://stackoverflow.com/a/104176/9668272

max_allowed_packet is set on SQL server side.

So, its more likely that somewhere in your project2 you send really big query to SQL server.

There are basically two ways to resolve it:

  • you can increase max_allowed_packet on your SQL server
  • or you can add project2 code to your question
hgb123
  • 13,869
  • 3
  • 20
  • 38