Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error en mysql. #9

Open
paulgil2 opened this issue Aug 4, 2020 · 1 comment
Open

Error en mysql. #9

paulgil2 opened this issue Aug 4, 2020 · 1 comment

Comments

@paulgil2
Copy link

paulgil2 commented Aug 4, 2020

Buenas:

Estoy aprendiendo mucho, por no puedo pasar este error busque todos los métodos y no logro dar con la solución.

TypeError: Cannot read property 'acquireTimeout' of undefined


this.acquireTimeout     = (options.acquireTimeout === undefined)
                                     ^

TypeError: Cannot read property 'acquireTimeout' of undefined
    at new PoolConfig (C:\Users\paul\Desktop\nodejs-mysql-app\node_modules\mysql\lib\PoolConfig.js:10:38)
    at Object.createPool (C:\Users\paul\Desktop\nodejs-mysql-app\node_modules\mysql\index.js:26:28) 
    at Object.<anonymous> (C:\Users\paul\Desktop\nodejs-mysql-app\src\database.js:6:20)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\paul\Desktop\nodejs-mysql-app\src\routes\links.js:4:15)

Estoy trabajando con los ultimas actualización de MySQL.

y no logro corregir el problema

agradecería una ayuda.

@Facu-mattiassi
Copy link

fijate si no escribiste algo mal, creo que me paso lo mismo, cuando escribia en el archivo database.js, yo me equivoque en un "n" de connection. Espero te ayude

pool.getConnection((err, connection) => {
if (err) {
if (err.code === 'PROTOCOL_CONNECTION_LOST') {
console.error('Database connection was closed.');
}
if (err.code === 'ER_CON_COUNT_ERROR') {
console.error('Database has to many connections');
}
if (err.code === 'ECONNREFUSED') {
console.error('Database connection was refused');
}
}

if (connection) connection.release();
console.log('DB is Connected');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants