MySQL Server using Sequelize gives error code ETIMEDOUT

Hello there folks,

I am currently facing an issue of not being able to connect to the MySQL server provided to me by InfinityFree.

InfinityFree username: epiz_30337716

Error Message: ConnectionError [SequelizeConnectionError]: connect ETIMEDOUT

errorno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
fatal: true

So I am developing a Discord bot that will be hosted on Heroku, however since Heroku doesn’t provide SQL, I decided to use InfinityFree’s SQL service. The problem is when I inserted the login information to Sequelize, it throws a timeout error. I’d be glad if you guys could help me out here :slight_smile:
Note that all of the config.X constants are environmental variables defined in a config.json file, and their values were CTRL+C CTRL+V’d from the InfinityFree account main page MySQL table.

The code of my database.js file:

const {Sequelize} = require("sequelize");
const config = require("../../Data/config.json");
module.exports = new Sequelize(config.DatabaseName, config.DatabaseUsername, config.DatabasePassword, {
    host: config.DatabaseHost,
    port: config.DatabasePort,
    dialect: "mysql"
});

Note that InfinityFree is website hosting, not database hosting. Because of this, you can only use your database in your InfinityFree website, and nowhere else.

1 Like

Oh so I can’t even debug the website that is on my own computer?
Then how are you meant to develop even anything on InfinityFree?

No remote SQL access on IF. You need premium hosting

Most people don’t develop on their webhost, they have an identical instance on their own computer. This makes things more efficient and faster.

Remote SQL is a feature not given for free. Instead of complaining about it, be happy that you actually get SQL databases for free in the first place.

3 Likes

Heroku provides their own PostgreSQL service, and last time I checked JawsDB provides a free MySQL tier. They are both services designed to be used as database hosting on Heroku.

Seeing how database connections are quite sensitive to latency, you’ll get garbage performance if you use some random database hosting provider. You should really look for database hosting in the same datacenter.

Thank you for your replies folks :slight_smile:

Yeah currently I am trying to make it work with Heroku with the free 5 MB database, but sadly, the app just doesn’t want to start with auto deploy set to GitHub repository main branch, even though all files are set as it’s in their documentation (Procfile has worker set, package.json has engine versions set, env variables set etc), and the log is literally empty, and they don’t provide support for free users.
And on StackOverflow, nobody replies to anything sadly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.