I'm trying to create a simple heat map based on longitudinal and latitudinal map coordinates that can be transferred from a database on MySQL that I've created. I read that CartoDB can be connected to other databases, but I'm not sure how to go about doing that.
CartoDB doesn't allow by default direct connections to the user databases to external databases. If you're not an enterprise customer, perhaps the Foreign Data Wrappers that CartoDB offers, as said in the comment, are not interesting to you.
The best approach would be connecting your database with the CartoDB SQL API so that you're able to maintain both datasources synchronised.