mysql connection issue
tamil2910
HOBBYOP
a month ago
Railway MySQL service cannot authenticate.
Railway Database UI:
Access denied for user 'root'@'127.0.0.1'
External mysql client:
ERROR 1045 (28000): Access denied for user 'root'@'100.64.0.12'
Password is copied directly from Railway Connect page.
The problem started after upgrading MySQL 9.4 -> 9.7.
1 Replies
Railway
BOT
a month ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 1 month ago
a month ago
Try this:
- Remember the current Custom Start Command
- Change the Custom Start Command to
docker-entrypoint.sh mysqld --skip-grant-tables --skip-networkingand redeploy - Go to the console tab of your MySQL service
- In the terminal, run
mysql -u root - Run the following commands:
ALTER USER 'root'@'localhost' IDENTIFIED BY '<PASSWD>';
ALTER USER 'root'@'%' IDENTIFIED BY '<PASSWD>';
FLUSH PRIVILEGES;Where <PASSWD> is replaced with the new password (From the variable MYSQL_ROOT_PASSWORD)
- Revert the custom start command and redeploy MySQL
- Make sure to restart other services that depend on your MySQL database