2 months ago
So i am able to replicate this issue with mysql+phpmyadmin
Install mysql , install phpmyadmin as seperate services. I am able to login from PA public url to mysql. all good.
Then in Mysql i go to Database> config > regenerate password.
now i can no longer login with phpmyadmin (obviously using new password)
i get mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'10.180.237.1' (using password: YES)
tried multiple installations, its repeatable for me.
any ideas?
3 Replies
Status changed to Awaiting Railway Response Railway • about 2 months ago
Status changed to Open Railway • about 2 months ago
2 months ago
Yeah this makes sense. When you regenerate the password in Railway's MySQL config, it updates the Railway environment variable ,but phpMyAdmin doesn't automatically get that new value because it's a separate service with its own environment snapshot.
What's happening
phpMyAdmin connects to MySQL using the password it was given at deploy time, stored in its own env vars (usually PPA_PASSWORD or MYSQL_ROOT_PASSWORD passed in at setup). Regenerating the password in MySQL's config updates MySQL's actual root password and Railway's variable on the MySQL service, but phpMyAdmin's service still holds the old one. Hence the 1045 access denied.
Fix
Go to your phpMyAdmin service's environment variables and manually update the password variable to match the newly generated one from MySQL's config. Then redeploy phpMyAdmin.
The exact variable name depends on how you set it up but it's usually PPA_PASSWORD, MYSQL_ROOT_PASSWORD, or whatever you passed as the connection password when configuring phpMyAdmin.
Longer term
Instead of hardcoding the password, reference it directly from the MySQL service using Railway's variable references. In phpMyAdmin's env vars set it as something like ${{MySQL.MYSQL_ROOT_PASSWORD}} ,that way if the password ever regenerates again, phpMyAdmin always pulls the current value automatically without needing a manual update.
That's the proper fix and it prevents this from happening again.
2 months ago
This is expected with Railway’s setup.
When you regenrate the MySQL password, only the database service gets updated. phpMyAdmin doesn’t “follow along” — it keeps using whatever password it had when it was last deployed, so the credentials go out of sync and login fails.
To fix it, just update the password in phpMyAdmin’s environment variables to the new one and redeploy the service.
If you don’t want to deal with this again, link the password using Railway’s service variable reference instead of hardcoding it. That way both services stay aligned even after regeneration.
2 months ago
You can replicate it with fresh install phpmyadmin and mysql, Once you generate new password, you can't login with phpmyadmin.
I've found the issue. The regenerate password changes the pass for root@localhost not for root@% . So solution was to login to Phpmyadmin using the OLD password. Then going to User accounts > Change password for root@%
There are two root users but the password change happens on one, phpmyadmin login uses the other.
Attachments
Status changed to Open brody • about 2 months ago
Status changed to Solved bananacy • about 2 months ago