MySQL is one of the most popular database systems available today. In this guide, we’ll walk you through how to set up and connect to MySQL from the popular database hosting infrastructure Railway.
Log in to your Railway account and click 'Create New Project' on the main dashboard page. Select 'Provision MySQL' to create your MySQL container.
You can also add a MySQL container to an existing Railway project. On your project’s main page, click 'Add Plugin' and select 'Add MySQL Plugin'
Select ‘MySQL’ from the left sidebar under ‘Environment,’ and navigate to the ‘Connect’ tab. Here, you’ll find all of the information you need to connect.
Click ‘show’ to reveal your MySQL password. You can interpret your credentials from the MySQL Client command like this:
mysql -h <host> -u <user> -p <password> --port <port> --protocol=TCP <database>
or from the connection URL like this:
Then, enter these credentials into your SQL client to connect: