All Questions
11,922
questions
0
votes
0
answers
25
views
Node zlib: throwing incorrect header check while inflating or unzipping
I have a varbinary type column jsonBin in db. I want to store json (string) which is compressed using zlib.
zlib.gzipSync(data) or zlib.deflateSync(data) returns buffer object.
If I use base64 ...
-2
votes
2
answers
33
views
Can i make a flexible function that can get * from different tables? [duplicate]
I am trying to create a function that can select from different tables in mysql
My Function
async function getOne(table, table_parameter, parameter) {
const result = await pool.query(
`SELECT * ...
0
votes
0
answers
21
views
ER_NOT_SUPPORTED_AUTH_MODE Error even though mysql2 is being used [duplicate]
I am receiving an error
ERROR [ExceptionHandler] ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
every time I try to ...
0
votes
1
answer
34
views
ORM Sequelize model.upsert() is not a function
Version sequelize 6.37.3
I try to upsert() myModel but the mehtod returns:
TypeError: model.upsert is not a function
my_model.controller.ts
...
class MyModelController {
private model: any;
....
0
votes
0
answers
22
views
While running server.js in kubernetes pods getting errors connect ETIMEDOUT
Error connecting to the database server: Error: connect ETIMEDOUT
at Connection._handleTimeoutError (/usr/src/app/node_modules/mysql2/lib/connection.js:205:17)
at listOnTimeout (internal/timers.js:557:...
-1
votes
0
answers
18
views
GET http://127.0.0.1:3001/search/3 404 (Not Found) error for retreiveing a record from a database
I am trying to create a web app to retrieve records from a mysql database but it seems i keep getting the 404 not found error. I am suing node.js for server side, and it seems that my endpoints are ...
-1
votes
0
answers
18
views
How to fix 'ER_FK_CANNOT_DROP_PARENT' error, 'ER_NO_SUCH_TABLE', 'ER_BAD_FIELD_ERROR' in Sequelize for MySQL? [duplicate]
When I run my server.js file I get the error mentioned in title.Also I get null violation errors when trying to insert into the TreeSeeds table. There is a foreign key called seedcompany_id in the ...
0
votes
1
answer
35
views
How to get Sequelize to recognize by primary key with MySQL database data set and fix bulkCreate() issue?
So I have a database where I am trying to establish a one-to-many relationship between Supplier and TreeSeed, whereby one Supplier can sell many TreeSeed. I have looked at the sequelize documentation ...
0
votes
1
answer
57
views
How to get Sequelize to recognize my custom foreign key and primary keys in a one-to-many relationship in MySQL during bulkcreate insert?
I am building a plant/arboretum style application in JavaScript. I am trying to create a one-to-many relationship between Supplier model and TreeSeed model. Meaning that one supplier can sell multiple ...
0
votes
0
answers
25
views
await is only valid in async functions and the top level bodies of modules nodejs [duplicate]
Basically using Nodejs I connect to mysql and create a pool using below code which works fine,
db.js
const mysql = require("mysql")
exports.database = mysql.createPool({
host: "...
0
votes
0
answers
20
views
Mysql rows transposing in Node.js with mysql2 [duplicate]
I am running an SQL script in Node.js using mysql2 npm-package. This script has multiple SQL statements that have to ultimately transpose a table's rows into columns. The SQL script runs correctly ...
-1
votes
2
answers
88
views
MySQL insert query successful but not inserting into database table
I am working on a React/MySQL registration page. The insert query runs, but is not inserting into the database table. I am not sure why.
In the backend folder, I have my server.js file:
const ...
0
votes
0
answers
21
views
Backend container connection issue to production database container in docker
I'm trying to link 3 containers run by Docker to a production stage.
The first container is hosting a vuejs 3 application and runs smoothly.
The issue arrives when I use the command :
sudo docker ...
0
votes
1
answer
32
views
Sequelize code first with mysql cannot generate database
I am facing an issue related to sequelize when generating the database by commandline
npx sequelize-cli db:migrate
The firsting I installing my sql and using MySQL Workbench to connect it -> ...
0
votes
0
answers
45
views
How to upsert data in mysql in NodeJS
I'm using MySQL for the first time through a NodeJS application. I'm managing to insert into a table, but I'm attempting to adapt my code to upsert the data instead, if a value matches. I've been ...