All Templates / Storage
MySQL
MySQL database with data persistence and TCP Proxy
MySQL
mysql
Just deployed
/var/lib/mysql
MySQL database deployed with the official Docker image.
A volume is mounted to the service to persist data between builds.
TCP proxying is configured to allow accessing the database from anywhere.
The MySQL container deployed from this template is started with the command below, to disable Async IO, binary logging, and server events, which helps to reduce usage and cost:
docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0
Reference the MYSQL_URL
variable from your service to connect to the database in your tool of choice (e.g. ${{MySQL.MYSQL_URL}}
)
Connect to the database using the proxied domain and port found on the service settings page. The password can be found on the Variables page.
In a terminal, for example:
mysql -h PROXY_DOMAIN -P PROXY_PORT -u root -p
Template Content
MySQL
mysqlDetails
Railway Templates
Created on Sep 7, 2023
22102 total projects
15930 active projects
Storage
More templates in this category