If you’re getting the error `Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation` while trying to import a database dump you have done using mysqldump, you might have encountered this issue.
In my situation, I am using Amazon Lightsail and migrating a database to a newer database instance. I ran a mysqldump and then attempted to import the dump into the new database.
You can fix the error by modifying the database dump file (.sql) which is being caused by SESSION.SQL_LOG_BIN and GLOBAL.GTID_PURGED lines. Or, you can use the force flag -f after the MySQL command.
mysql -f -u dbname -p -h hostvalue -D databasename < dbdump.sql
You will still get errors when you run the import, but it won’t prevent it from happening. Without -f, any errors will cause the MySQL command to fail. This flag tells it to ignore the errors and keep going.