R
Railway•12mo ago
lukasgjetting

Unable to connect to a custom MySQL deployment (Dockerfile + volume)

I am currently trying to deploy MySQL via a custom Dockerfile (I need to change innodb_ft_min_token_size, which is not possible with the default MySQL deployment). I am using a simple Dockerfile:
FROM mysql:8.0.33

ARG DB_PASS

ENV MYSQL_ROOT_PASSWORD=$DB_PASS
ENV MYSQL_DATABASE=railway

EXPOSE 3306
FROM mysql:8.0.33

ARG DB_PASS

ENV MYSQL_ROOT_PASSWORD=$DB_PASS
ENV MYSQL_DATABASE=railway

EXPOSE 3306
Looking at the build + deploy logs, everything seems to work correctly. However, I cannot connect to the database. I have connected a default Railway domain. When accessing it via a browser, I get the following error: upstream connect error or disconnect/reset before headers. reset reason: protocol error. When connecting to <railwayDomain>:80 via MySQL Workbench, I get the following error: Lost connection to MySQL server at 'reading initial communication packet', system error: 0. Trying to connect to port 3306 results in a timeout. Am I missing anything? Thanks. 🙂
Solution:
you will not be able to connect to the database externally without some kind of tunnel, railway does not support accessing services over anything but https and 443 externally, you can only connect to it from another service in the same project with the private networking and internal domains
Jump to solution
9 Replies
Percy
Percy•12mo ago
Project ID: 82bf36ca-fd00-4567-9aa9-5f90227d2f00
lukasgjetting
lukasgjetting•12mo ago
82bf36ca-fd00-4567-9aa9-5f90227d2f00 Additionally, the Railway env variable PORT is set to 3306
Solution
Brody
Brody•12mo ago
you will not be able to connect to the database externally without some kind of tunnel, railway does not support accessing services over anything but https and 443 externally, you can only connect to it from another service in the same project with the private networking and internal domains
The Big E in Math -> Σ
Just curious if you have any plan to support non-http protocol in the future
Brody
Brody•12mo ago
yes there was an announcement from cooper that says they plan to support TCP/UDP in the future at some point, no ETAs where given
The Big E in Math -> Σ
Good to know, thanks.
Brody
Brody•12mo ago
no problem! and of course the internal network supports non-http protocols
lukasgjetting
lukasgjetting•12mo ago
Ok - thank you for the answer
Brody
Brody•12mo ago
people have been able to run a Minecraft server on railway through an ngrok tunnel, if it works for Minecraft, should work for a database lol