a month ago
Problem description: We used a password regeneration tool for the root user of our database. However, after the process was completed, Railway redeployed the database, but the new password was not applied correctly; the connection still works only with the old password.
Expected behavior: The newly generated password should be applied correctly, and the old password should no longer be valid.
Current behavior: The database was redeployed, but it continues to use the old password.
2 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
a month ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open noahd • about 1 month ago
a month ago
Hi, here's the guide I always give.
⠀
Before you do any of this, disable all public access domains. Just in case.
⠀
Install the Railway CLI. You can do so here: https://docs.railway.com/guides/cli
Copy the SSH command by right clicking the PostgreSQL service
Once you're in, type in the following command: (Copy paste this EXACTLY as written.)
sed -i 's/host all all all scram-sha-256/host all all ::\/0 trust/' /var/lib/postgresql/data/pgdata/pg_hba.confRedeploy your database.
Use the SSH command again, and once you're in, type
psql.Type the following SQL command.
my_passwordshould be replaced with whatever it actually says in your variables tab for your password (Probably under thePGPASSWORDvariable.)ALTER USER postgres with password 'my_password';Type
exitReset your authentication settings with the following command:
sed -i 's/host all all ::\/0 trust/host all all all scram-sha-256/' /var/lib/postgresql/data/pgdata/pg_hba.confRedeploy your database once again. You have now changed the password.
⠀
Let me know if this works!