I have tried how to figure out this. but the only idea is using grep
and remove TABLES in inforation_schema like this: this example removes 3 tables from dump.sql
egrep -v '(GLOBAL_VARIABLES|CHARACTER_SETS|COLLATIONS)' dump.sql > new_dump.sql
in practice, 40 tables should be given....
I hope you succeed.
FYI. one database is 40GB? how many tables in there. To restore dump file quickly, in later separate big tables or databases from each other. and load concurrently.