Flyctl proxy hangs

I was following the guide on setting up a MySQL database (Use a MySQL Database · Fly Docs).

One of the last steps is to proxy connect to the database with:
flyctl proxy 13306:3306 -a my-app.

When I run this command, I see:
Proxying local port 13306 to remote [my-app.internal]:3306.

After that, nothing happens. It just seems to hang indefinitely. I also tried to proxy in another application I have running, but with the same result.

I have only recently started using Fly. This is the first time I try to use the proxy.

Does anyone have any suggestions on fixing this issue?

This is intended behavior - the proxy runs in the foreground, so that you can just Ctrl+C it when you’re done with it.

Just run it in one terminal, then open another to actually make use of it.

1 Like

Ahhh. Ok I feel stupid now :joy:
Thanks for clarifying.

@allison I might be doing another thing wrong actually. I have the proxy running but when I try to connect in a new terminal with:
mysql -h localhost -P 13306 -u root -p and enter the password, I get connected to my local instance of mysql.

EDIT: replacing localhost with 0.0.0.0 did the trick.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.