Skip to content
Railway MySQL Database UI connection failure via SSH tunnel
kevinkalenga
OP

4 months ago

Hello Railway team,

The Railway MySQL Database UI fails to connect with:

Access denied for user 'root'@'127.0.0.1' (using password: YES)

However, the database connection is fully functional:

  • Laravel connects successfully via mysql.railway.internal:3306
  • SQL queries work from the application container
  • Direct MySQL client connection works from the application container
  • Only the Railway MySQL Database UI fails through the SSH tunnel

I verified:

  • DB::select('SHOW TABLES') returns my tables
  • mysql -h mysql.railway.internal -P 3306 -u root -p connects successfully

The issue appears to be related to the Database UI SSH tunnel using 127.0.0.1 instead of the internal MySQL connection.

Project: respectful-creation

Environment: production

MySQL Service: bd5d68ac-425b-456e-9a08-36e8b06306af

MySQL image: mysql:9.4

Region: sfo

Please investigate the SSH tunnel / Database UI connection.

Thank you.

Solved$20 Bounty

Pinned Solution

Try this:

  1. Remember the current Custom Start Command
  2. Change the Custom Start Command to docker-entrypoint.sh mysqld --skip-grant-tables --skip-networking and redeploy
  3. Go to the console tab of your MySQL service
  4. In the terminal, run mysql -u root
  5. 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)

  1. Revert the custom start command and redeploy MySQL
  2. Make sure to restart other services that depend on your MySQL database

1 Reply

Railway
BOT

4 months ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 4 months ago


Try this:

  1. Remember the current Custom Start Command
  2. Change the Custom Start Command to docker-entrypoint.sh mysqld --skip-grant-tables --skip-networking and redeploy
  3. Go to the console tab of your MySQL service
  4. In the terminal, run mysql -u root
  5. 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)

  1. Revert the custom start command and redeploy MySQL
  2. Make sure to restart other services that depend on your MySQL database

Status changed to Solved 0x5b62656e5d • 26 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...