I was able to come up with a solution according to advice from the comments. Working code:
function import_shows() {
$olddb = new wpdb(constant("DB_USER"),constant("DB_PASSWORD"),"THE_DB",constant("DB_HOST"));
$sql = "SELECT * FROM shows";
$rows = $olddb->get_results($sql);
foreach($rows as $obj) {
error_log($obj->name);
}
return;
}