Hi @Abdelrhman Goma ,
Regarding to your query above for getting public IP instead of the private IP while creating a Private DNS Zone privatelink.mysql.database.azure.com
and linked it to the same VNet as the private endpoint.
Hope above comment helps you & in addition to that,
1.Please check the DNS resolution is correctly routing through your Private DNS Zone or not
2.Verify that the Private DNS Zone is linked to the same VNet where the Private Endpoint is deployed.
3.Ensure auto-registration is disabled.
4.Azure Cloud Shell runs in a separate VNet and does not use your custom DNS settings.
therefore,it will resolve to the public IP, so, use a VM inside your VNet to test DNS resolution or configure a custom DNS forwarder (e.g., Azure Firewall DNS proxy or a VM running DNS) and point your VNet to it.
5.Testing from Inside the VNet
Run nslookup vpn-db-test.mysql.database.azure.com from a VM inside the same VNet as the Private Endpoint.
Please find the microsoft link for the reference.
https://learn.microsoft.com/en-us/azure/dns/dns-private-resolver-overview
For access to db throw sql workbench:
1.If you're using Azure Database for MySQL, please check for incorrect or expired password.
2.Confirm that MySQL is running on the server and listening on the correct port (default is 3306).
If you find this comment helpful, Please do not forget to “up-vote” for the information provided , this can be beneficial to community members.
Please let us know if you have any further queries.
Thanks