I want to confirm if I understand this

I want to confirm if I understand this correctly, before i make a mistake by exposing the db publicly.

I have a db running on third-party cloud provider, along with a cloudflared container in the same network.
Now, from this docs: https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database/#12-connect-your-database-using-a-public-hostname

I need to create a public hostname <random_name>.<my_domain>.com/
and point it to db mysq://... with TCP type

Question:
1. If I link my db to make it accessible publicity via endpoint wouldn't anyone access it?
2. Do I need to enter the db username and password in type TCP url as well?

When I create a hyperdrive configuration, I can see it does ask for the db name, username and password.
Does that mean, that I do not have to add username, password and db name in the tcp url?
Was this page helpful?