Help with MySQL Access via Cloudflare Tunnel
I’m trying to get remote access to a MySQL database (port 3306) through a Cloudflare Tunnel.
I’m running the following command in the terminal:
cloudflared tunnel --url tcp://localhost:3306
However, I get an error in the terminal:
malformed HTTP response "J\x00\x00\x00"
I understand that MySQL is not an HTTP service, but is there a way to proxy TCP connections through Cloudflare Tunnel, or how can I correctly forward MySQL traffic (for example, using cloudflared access or other mechanisms)?
The goal is to connect to MySQL (localhost:3306) from a remote machine without opening a port on the firewall or router.
Is TCP proxying for MySQL supported with Cloudflare Tunnel? I couldn’t find a clear instruction for this.


4 Replies
Feedback
Feedback has been submitted! Thank you :)
Have you also installed Cloudflared on the client? Proxying mysql via the tunnel definitely works.
Cloudflare Docs
Arbitrary TCP
Cloudflare Access provides a mechanism for end users to authenticate with their single sign-on (SSO) provider and connect to resources over arbitrary TCP without being on a virtual private network (VPN).
2025-07-28T07:38:08Z ERR Error on Websocket listener error="failed to start forwarding server: listen tcp 192.168.56.1:...: bind: An attempt was made to access a socket in a way forbidden by its access permissions."
failed to start forwarding server: listen tcp 192.168.56.1:...: bind: An attempt was made to access a socket in a way forbidden by its access permissions.?(
.