a month 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
a month 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
a month 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
a month 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
a month ago
Is this correct?
a month 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?
a month ago
No need to ping, pepper is handling this.
a month ago
Try running the alter command but instead of localhost, put %.
a month ago
Sorry, but just to clarify, you ran ALTER USER 'root'@'%' IDENTIFIED BY '';, yes? Where `` has the new password.
a month ago
Good to know.
a month ago
Almost scared me haha, spun up a test MySQL instance just to test the ALTER commands and it was working on my end.
a month ago
No worries.
Status changed to Solved brody • about 1 month ago
a month ago
We have also fixed this, so you won't have to manually run SQL going forward.