I experienced this issue recently while syncing a database from an Acquia hosted dev environment to my local environment. This error led me to investigate the dump file which I found included global transaction identifier (GTID) sets. I was able to work around this issue by suppressing the GTID sets using the --set-gtid-purged=OFF option for the mysqldump command. Combining that option with the drush sql-sync command allows a successful sync.
Note: This technique also works for other versions, just change the version number. For example, if you want to to install PHP5.6 or PHP7.3. Just change the version number wherever it appears, such as php56-apache2handler or php73-mysql.
I received this error when I tried to reinstall Drupal. I was creating a feature to include on other sites, and wanted to make sure everything worked on a clean install. The problem was caused by the following line in my settings.php file, which I added for the Domain Access module:
include './sites/all/modules/contrib/domain/settings.inc';
Commenting out that line allowed Drupal to install successfully.