at Connection._handleTimeoutError (/app/node_modules/mysql2/lib/connection.js:205:17)
Hello community, I am getting the following error when deploying my API. I am using the database of a dedicated server and in the HOST I am placing the IP, but it keeps showing me the following error:
Error connecting to the database π¨ Error: connect ETIMEDOUT
Please help!! π¦ it is my first time doing deploys of my application and I took into account Railway for this project.
28 Replies
Project ID:
N/A
where is the database hosted?
It is hosted on a quality server, the database is in MySQL language.
so you mean to say it is not hosted on railway?
No, I am using directly the HOST output of the db
Do I have to upload the db in Railway?
Is it necessary?
is the database hosted on railway? (yes/no)
No
what environment variables are you using in code when connecting to the database
DB_PORT, DB_HOST, DB_USER, DB_PASSWORD, DB
do you have those set in your railway service variables?
Yes, I have them configured in the same way as in my .env file.
have you whitelisted all IP addresses in your database host?
whitelisted ?
Is it a configuration file?
Sorry if I ask too much, but I'm a noob at this.
This is my first deploy
please look into whitelisting with your current database host
Where do I find that?
you would need to contact your database host and ask them
Hi, it's me again. I have made the corresponding changes to my database settings (including the whitelisted IP) but I still have the same problem.
please make sure all the environment variables are correct
Yes, I made sure of that but it still shows the same error.
make sure you allow your app on railway to access your database
I have the public app
not quite sure what that has to do in relation to what I've said
Do you think it would be better to use a proprietary database model from railway?
Instead of using my server's db
the databases arent proprietary in any way shape or form, they are regular bog standard postgres databases.
but yes using them would make this so much easier.
I have too many tables in the database that I want to copy to Railway, is there any way to upload my exported.sql?
pg_dump and pg_restore
I'm using MySQL
mysql has tools to dump and restore a database too