Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

334
Vistas
Not able to connect to mysql using TypeORM

I have my nodejs setup using expressjs and typeorm (v. 0.2.25). My node js version is 12.18.0

I am using Mac OS to debug my application.

Below is the problem i faced: (Note: There is no problem compiling in windows.)

QueryFailedError: Connection lost: The server closed the connection.
....
 fatal: true,
  code: 'PROTOCOL_CONNECTION_LOST',
  query: "SELECT * FROM `INFORMATION_SCHEMA`.`TABLES` WHERE ....

I am using

await createConnection(); 

from typeorm and my typeorm.config is properly setup as follow

 "type": "mysql",
   "host": "localhost",
   "port": 3306,
   "username": "root",
   "password": "root",
   "database": "myDB",
   "synchronize": true,
   "logging": false,
   "entities": entities,
    ...

To take note that if the "synchronize" is set to false there is no problem debugging, the error only comes out if I set it to true.

Any one face this problem using typeorm? Search around but never get a proper answer. Any one had this experience b4 please help.

Thanks.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda