3 months ago
I have tried multiple times to regenerate the MySQL DB password via Database -> Config -> Regenerate Password. Once triggered, the database redeploys and the environment variables update in the Railway console, however when connecting to the DB, the new password does not work and the original one still works.
We need this fixed ASAP.
Thanks in advance.
27 Replies
3 months ago
Try this:
- SSH into your MySQL service (Right click the service and Copy SSH Command) (You'll need Railway CLI installed for this to work)
- In the terminal, paste the SSH command and run
mysql -u root -p - Enter the current working password
- Run the following commands:
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
FLUSH PRIVILEGES;Where `` is replaced with the new password (From the variable MYSQL_ROOT_PASSWORD
3 months ago
This should reset the MySQL's password to use the newly generated password in the variables tab.
@pepper very odd.. so when running mysql -u root -p, it only acepts the new password, but when connecting externally, this password doesn't work and I can only use the original password
3 months ago
- External connection requires old password
- Root access via SSH uses new password
- Current Railway variable is new password
- Railway's database UI doesn't connect
3 months ago
Is this correct?
3 months ago
- External connection requires old password
- Root access via SSH uses new password
- Current Railway variable is new password
- Railway's database UI does connect -# Oops accidentally deleted old msg
I ran the alter user command just now, didn't expect anything to change, and I was correct
So it seems the proxy has its own auth system maybe, once its happy with the password received externally it just tunnels the connection thru Railway?
3 months ago
No need to ping, pepper is handling this.
3 months ago
Try running the alter command but instead of localhost, put %.
3 months ago
Sorry, but just to clarify, you ran ALTER USER 'root'@'%' IDENTIFIED BY '';, yes? Where `` has the new password.
3 months ago
Good to know.
3 months ago
Almost scared me haha, spun up a test MySQL instance just to test the ALTER commands and it was working on my end.
3 months ago
No worries.
Status changed to Solved brody • 3 months ago
3 months ago
We have also fixed this, so you won't have to manually run SQL going forward.