Can't connect with mysql

Project name: autopsy-bot
Hi!
I’m trying to connect with my mysql database and i have this error:

Error: connect ETIMEDOUT

7:53 PM

at Connection._handleConnectTimeout (/rbd/pnpm-volume/89f654ff-34c1-4f95-848a-5a6fa612b4d1/node_modules/.registry.npmjs.org/mysql/2.17.1/node_modules/mysql/lib/Connection.js:412:13)

7:53 PM

at Object.onceWrapper (events.js:313:30)

7:53 PM

at emitNone (events.js:106:13)

7:53 PM

at Socket.emit (events.js:208:7)

7:53 PM

at Socket._onTimeout (net.js:422:8)

7:53 PM

at ontimeout (timers.js:498:11)

7:53 PM

at tryOnTimeout (timers.js:323:5)

7:53 PM

at Timer.listOnTimeout (timers.js:290:5)

7:53 PM

--------------------

7:53 PM

at Protocol._enqueue (/rbd/pnpm-volume/89f654ff-34c1-4f95-848a-5a6fa612b4d1/node_modules/.registry.npmjs.org/mysql/2.17.1/node_modules/mysql/lib/protocol/Protocol.js:144:48)

7:53 PM

at Protocol.handshake (/rbd/pnpm-volume/89f654ff-34c1-4f95-848a-5a6fa612b4d1/node_modules/.registry.npmjs.org/mysql/2.17.1/node_modules/mysql/lib/protocol/Protocol.js:51:23)

7:53 PM

at Connection.connect (/rbd/pnpm-volume/89f654ff-34c1-4f95-848a-5a6fa612b4d1/node_modules/.registry.npmjs.org/mysql/2.17.1/node_modules/mysql/lib/Connection.js:119:18)

7:53 PM

Jump to

at Object.<anonymous> (/app/server.js:52:12)

7:53 PM

at Module._compile (module.js:653:30)

7:53 PM

at Object.Module._extensions..js (module.js:664:10)

7:53 PM

at Module.load (module.js:566:32)

7:53 PM

at tryModuleLoad (module.js:506:12)

7:53 PM

at Function.Module._load (module.js:498:3)

7:53 PM

at Function.Module.runMain (module.js:694:10)

I added project ip to remote mysql whitelist…
Please, help! :<

Hey @Kunoji, I tried connecting to your database server using telnet and the details in your server.js file (I’d strongly advise you to move some of that config info - particularly your password - to your project’s .env file and referring to it using process.env for additional security, by the way) in your project’s console and that connection timed out.

You may have whitelisted a specific IP address on the remote end, but keep in mind that Glitch project IP addresses change regularly - as often as every 12 hours, in fact - so whitelisting is difficult to keep up-to-date. You can check your project’s current IP by using curl ifconfig.co in your project’s console to verify whether your current IP address is in fact whitelisted.

Hope this helps!

I know about it, so i whitelisted actual IP… still nothing :<

When I telnet from your project’s console to a non-firewalled MySQL instance of my own I receive a mysql login prompt, so I can verify that outgoing connections to arbitrary IP addresses using the MySQL port from your project are working just fine. If you’re not able to connect then I expect some portion of the connection details is wrong somewhere along the line, or your whitelist is incorrect in some way. Perhaps your database host’s support might be able to shed some light?

I’m using cpanel to whitelist project’s ip adress, connection details are 100% correct, because it was working yestarday :confused:
Anyway, thank you for trying to help!
Greetings

That makes sense, since your project’s host (and IP address) changed at 2019-07-02 21:49 UTC and it had also changed about 10 hours before that.