How can I make it so that I can remotely connect to the site's database, how should I specify the site's hostname, etc.?

How can I make it so that I can remotely connect to the site’s database, how should I specify the site’s hostname, etc.?