I'm having a problem connecting to a database through the mysql2 module for Node.js.
Everything worked, before I deleted some file to do with Git. After reinstalling everything trying to fix it... still doesn't work.
Node outputs:
Error: connect ECONNREFUSED ::1:3306 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16) Emitted 'error' event on Connection instance at: at Connection._notifyError
at Socket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -61, code: 'ECONNREFUSED', syscall: 'connect', address: '::1', port: 3306, fatal: true
edit: In my connection I specify localhost as the host, and I can connect to the database in the terminal using the same user as my connection object.