I'm not sure about HeidiSQL but I've had great luck with MySQL database exports using PHPStorm. I think PHPStorm essentially has DataGrip built-in:
https://www.jetbrains.com/datagrip/
After having trouble with workbench, Using PHPStorm I was able to export a whole database to a file per table in one go and both TSV/CSV are supported. I found my resultant CSV files to be reliably escaped.
After having trouble with workbench, Using PHPStorm I was able to export a whole database to a file per table in one go and both TSV/CSV are supported. I found my resultant CSV files to be reliably escaped.