First you login to whatever that gives you control over settings of example.com. Then you set up your nameservers properly: Here you can sign-up and use cloudflare as a free easy solution and use their nameservers for your domain (for example they might give you fay.ns.cloudflare.com and ara.ns.cloudflare.com). If you did that then it's time to add some DNS records: login to your cloudflare account and in the DNS section create an A RECORD (an ipv4 address) to point your @ (it means example.com without any subdomain) to your xxx.xxx.xxx.xxx. And it should work.
In case you don't want to get your own domain and do all these name server stuff there is a local solution: You can tell your development machine that example.com should resolve to xxx.xxx.xxx.xxx. In Linux you do that by editing /etc/hosts file and appending this line:
xxx.xxx.xxx.xxx example.com
But be aware that the second solution only works for machines that have this kind of configuration and it is not global like previous one.
In either case you don't need to set-up any webserver. DNS is web-agnostic, it happens whether there is a webserver or not, or even the address belongs to a real server or it's just a random number.
In your case the thing is important is that the port be accessible from outside (configuring your firewall properly) and something is listening on it not just locally (127.0.0.1:3306) but also on xxx.xxx.xxx.xxx:3306. Usually you do that by listening 0.0.0.0:3306 with 0.0.0.0 as a wildcard to listen in all of them.