Skip to content
MySQL Root Password Recovery Without Data Loss
tusharmarathe204-glitch
OP

3 hours ago

Subject: Help Required – MySQL Root Password Recovery Without Losing Existing Data

Hello Railway Support Team,

I am facing a MySQL root password authentication issue with my Railway project.

Project: trustworthy-vitality

Environment: production

Service: MySQL

MySQL Version: 8.4.13

My MySQL service is running successfully, and the persistent volume is mounted at /var/lib/mysql.

However, I cannot log in using the MYSQL_ROOT_PASSWORD environment variable. Railway's Regenerate Password option also fails because the database rejects the current password.

I do not have any backups available.

Important: I need to recover or reset the MySQL root password while preserving all existing database data.

Please guide me through a safe password recovery procedure. I do not want to delete, reset, or recreate the existing volume.

Thank you.

Awaiting User Response

4 Replies

Railway
BOT

3 hours ago

Recovering or resetting the MySQL root password inside the database is database administration, and that stays with you or your database administrator. We can't log into the database, recover the credential, or carry out a custom recovery on your behalf, and we can't confirm that any particular reset procedure will keep your existing data intact.

Your MySQL service has a persistent volume attached and its latest deployment is running, so we have nothing showing the data is gone. The Regenerate option only works when the database still accepts the current password, so it isn't a fix in this state. Before you change anything, it's worth making your own copy of the data.


Status changed to Awaiting User Response Railway • about 3 hours ago


2 hours ago

Have you ever changed the root password directly in your database?


Status changed to Awaiting Railway Response Railway • about 2 hours ago


Status changed to Awaiting User Response Railway • about 2 hours ago


tusharmarathe204-glitch
OP

2 hours ago

No, I have never changed the root password directly inside the database.

I have only tried using Railway's MYSQL_ROOT_PASSWORD environment variable and the Regenerate Password option.

I want to recover access to my existing MySQL database without losing any data or deleting the persistent volume.

Could you please guide me through the safest recovery procedure for MySQL 8.4.13?


Status changed to Awaiting Railway Response Railway • about 2 hours ago


Railway
BOT

2 hours ago

Thanks for confirming you only used the variable and the Regenerate option. Recovering or resetting the MySQL root password inside the database is database administration, so choosing and running a recovery procedure stays with you or your database administrator. We can't log into the database or recover the credential for you, and we can't confirm that any particular reset procedure will keep your data intact.

The Regenerate option only works while the database still accepts the current password, so it won't help in this state. Editing MYSQL_ROOT_PASSWORD by hand changes only the variable, not the password the database checks.

Your MySQL service is still running with its persistent volume attached. If you'd like input from other users who have done a MySQL 8.4 root reset, you can ask the community at station.railway.com/questions.


Status changed to Awaiting User Response Railway • about 2 hours ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...