Setting up a database on a dedi

Pretty simple really, just wondering how I would go about setting up a database on a dedi, is there any way of hosting the db externally and linking it somehow?