Hi,
I want to deploy my full-stack application with a client, server, and mysql database. So far, I have successfully deployed the client, which is a static site. Now, I’m having problems with deploying the server, which is a web service. When I deploy it, I get this error over and over again:
Running ‘npm start’
May 24 12:48:48 AM
May 24 12:48:48 AM> server@1.0.0 start
May 24 12:48:48 AM> node index.js
May 24 12:48:48 AM
May 24 12:48:51 AMConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 127.0.0.1:3306
May 24 12:48:51 AM at ConnectionManager.connect (/opt/render/project/src/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:17)
May 24 12:48:51 AM at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
May 24 12:48:51 AM at async ConnectionManager._connect (/opt/render/project/src/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:222:24)
May 24 12:48:51 AM at async /opt/render/project/src/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:174:32
May 24 12:48:51 AM at async ConnectionManager.getConnection (/opt/render/project/src/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:197:7)
May 24 12:48:51 AM at async /opt/render/project/src/server/node_modules/sequelize/lib/sequelize.js:305:26
May 24 12:48:51 AM at async MySQLQueryInterface.tableExists (/opt/render/project/src/server/node_modules/sequelize/lib/dialects/abstract/query-interface.js:102:17)
May 24 12:48:51 AM at async Users.sync (/opt/render/project/src/server/node_modules/sequelize/lib/model.js:939:21)
May 24 12:48:51 AM at async Sequelize.sync (/opt/render/project/src/server/node_modules/sequelize/lib/sequelize.js:377:9) {
May 24 12:48:51 AM parent: Error: connect ECONNREFUSED 127.0.0.1:3306
May 24 12:48:51 AM at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16) {
May 24 12:48:51 AM errno: -111,
May 24 12:48:51 AM code: ‘ECONNREFUSED’,
May 24 12:48:51 AM syscall: ‘connect’,
May 24 12:48:51 AM address: ‘127.0.0.1’,
May 24 12:48:51 AM port: 3306,
May 24 12:48:51 AM fatal: true
May 24 12:48:51 AM },
May 24 12:48:51 AM original: Error: connect ECONNREFUSED 127.0.0.1:3306
May 24 12:48:51 AM at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16) {
May 24 12:48:51 AM errno: -111,
May 24 12:48:51 AM code: ‘ECONNREFUSED’,
May 24 12:48:51 AM syscall: ‘connect’,
May 24 12:48:51 AM address: ‘127.0.0.1’,
May 24 12:48:51 AM port: 3306,
May 24 12:48:51 AM fatal: true
May 24 12:48:51 AM }
May 24 12:48:51 AM}
Is this an issue where I have to change my database in my project? Or do I have to create something else to run my mysql database?