MySQL
The Railway MySQL database service allows you to provision and connect to a MySQL database with zero configuration.
Connect
There are two ways to connect to a MySQL database:
- Add a Reference Variable to a service
- Run
railway connect
to start amysql
shell
The following variables can be referenced in your services:
MYSQLHOST
MYSQLPORT
MYSQLUSER
MYSQLPASSWORD
MYSQLDATABASE
MYSQL_URL
Connect to your MySQL container using your library of choice and supplying the appropriate environment variables.
Image
The MySQL database service uses the mysql:8 docker image.
Changing System Variables
We do not support changing System Variables for MySQL at the moment.
Was this page helpful?
Edit this file on GitHub