All Templates / Storage

MySQL

MySQL

MySQL database with data persistence and TCP Proxy

Deploy MySQL

MySQL

mysql

Just deployed

/var/lib/mysql

Overview

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.

Start Command

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

How to use

Reference the MYSQL_URL variable from your service to connect to the database in your tool of choice (e.g. ${{MySQL.MYSQL_URL}})

Connecting

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

mysql
Deploy Now

Details

Railway Templates

Created on Sep 7, 2023

22102 total projects

15930 active projects

Storage



More templates in this category

View Template
ReadySet

ReadySet

A lightweight caching engine for Postgres


Milo

View Template
EdgeDB

EdgeDB

EdgeDB template based on their Docker deployment guide


Ajit Krishna

View Template
Apache Kvrocks

Apache Kvrocks

A drop-in replacement for Redis to store data on a volume.


Bram