R
Railway

✋|help

I can no longer connect to my MySQL database, even after restarting the database

Sswordgeo8/24/2023
I'm not sure what my project id is. My link is this:
https://railway.app/project/31b9ee92-06cc-44c1-b7ac-f0e1ce21e2f1

So basically I'm using this database to serve my website. I released to production and I was having issues where the connections would drop from inactivity after a few minutes. Consulting ChatGPT, it said a dirty fix would be a periodic ping of the database to keep the connection going, so I set on up on a 2 minute timer.

This worked for a day or two perhaps, before the database wouldn't allow a connection, either from production environment or even locally or from MySQL Workbench.

I hopped on the Railway website, hit "restart database", and everything was fine, for another day.

Now I am unable to connect to the database in any way, even when I attempt to restart the database again.

I'm inexperienced with this kind of thing and would appreciate help from those wiser than I.
Bbrody1928/24/2023
and you are absolutely positively sure you are using the correct credentials when using mysql workbench?
Sswordgeo8/24/2023
90% sure I'd suppose. I'm trying to connect in the same ways using the same saved values that have always worked before this issue. I checked to see that the database should be using the same port as it's always been using, etc.
Bbrody1928/24/2023
go and copy the credentials fresh from the mysql database plugin itself
Sswordgeo8/24/2023
Yes sir, just a sec
Bbrody1928/24/2023
if you get an error, take a screenshot to show me
Sswordgeo8/24/2023
Sswordgeo8/24/2023
"Unable to connect to localhost"
It seems to not be sure even what the problem could be.
Bbrody1928/24/2023
it seems as though you may not be entering the credentials correctly
Sswordgeo8/24/2023
I suppose that's possible. But even if I try to play with the database inside the Railway site, it doesn't seem to want to cooperate.
Bbrody1928/24/2023
alright i will flag the team, because its clear that at least something happened that shouldn't have
DDuchess8/24/2023
Thread has been flagged to Railway team by @Brody.
Sswordgeo8/24/2023
Thank you, I appreciate that.
Bbrody1928/25/2023
@Ray - hey I think this needs a little attention 🙂
Rrayofbytes8/25/2023
^ Thanks!
@Swordgeo did you run any queries to alter the db?
Sswordgeo8/25/2023
Not as far as I know.

I had just released my site to production, and was encountering a problem of connections timing out naturally after a few minutes.

So I set up a ping to kinda keep it open like so:

setInterval(() => {
connection.query('SELECT 1', (err) => {
if (err) {
console.error('Error pinging database:', err);
} else {
console.log('Pinged database successfully.');
}
});
}, 2.5 * 60 * 1000); // Ping every 2.5 minutes


In hindsight something about this is probably where the stupidity happened.

After a day or two that's when I stopped being able to connect entirely.
Rrayofbytes8/25/2023
Do you have any important production data on it?
Looks like your db is in an unrecoverable state due to data corruption; we've never seen this before and not sure how it happened. I'll dig further next week and attempt a restore for you. Sorry bout this 🤞
Sswordgeo8/26/2023
Gotcha. As far as "important" data, sure, it will be a pain, but I can recover all of it in due time.
I've partially set up the means to do so. If something can be recovered, awesome; if there's nothing that can be done it is what it is.

Thank you for the help; now I don't have to wonder and spin my wheels.

If you could let me know when I can begin rebuilding I'd greatly appreciate that.
Rrayofbytes8/28/2023
Can I DM you?
Sswordgeo8/28/2023
Certainly. Lay it on me and I’ll happily respond tomorrow morning

Looking for more? Join the community!

Recommended Posts
RPC showing forbidden access 403Hi. I've got some crypto related script which pings an RPC server - it works fine locally but on raiHow would I connect my project with the SQL database ?I have a model for users and I would like to populate my production DB with them. How can I do that?Hipaa/socI wanted to confirm if the information on https://railway.app/help is current as the email listed boMemory consumption differenceSame app deployed in docker local and Hw(M1 16gb) consumes 52 mb with no load railway took 74mb can Nextjs 13 Environmental variableHello! I recently installed Nextjs to try out the "new" app directory, because I heard server actioRailway CLI postgresql not installed?I installed the CLI and postgresql on my computer to use pgloader to migrate a mysql db to postgres How do I hook up my frontend correctly./I am able to deploy my backend but my frontend is not working yet. Error: ``` #8 [4/5] RUN npm ruStyling bug on project service usage pageIs there a way I can have Railway restart manually every 2 hours?Pretty self explanatory, I’m running some js codePostgres, Aspnet Core API and Angular WebguiHi guys. I'm new here and getting to know railway! I find it fantastic for us. I am lost. I would lCannot change default provider for environment thats created during GitHub Pull RequestI posted about this a while back (https://discord.com/channels/713503345364697088/112689969354953113expressidkI'm not sure on how to transfer my wiki.js database data to railway.86f37e49-db7c-4b6f-9c3e-71f5447b116a I am either getting a broken wiki.js database that results in Build and deployment is accountable in service consumptionconsider in a context of docker image number of images downloaded and each operation performed in doQuestion about billHello i have a railway acount and i work with my accounting team but they need an tax number identifEnvironment Variable Not foundI am using nodejs as a backend and the config plugin with it to get the access to the Railway envoirERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sockI tried deleting my Railway proc file and getting this error now ERROR: Cannot connect to the DockerNeed wordpress template helpI have this error: Please contact your hosting service and ask them to increase max_input_vars valueCan't login using my emailHi there, I'm trying to login to my account using the magic link, but whenever I do it I get this erDjango Deployment Issue - 503 Error on Railway PlatformHello, I am encountering a 503 error ("Application failed to respond") while deploying my Django ap