Currently, Cloudflare D1 doesn’t support MySQL and will be in soon future:
However, if you want to use database.mydomain.com proxied hostname to connect to over some port, you’d have to setup and use cloudflared tunnel and Arbitrary TCP to achieve this: