I used Mysql Workbench to export multiple schemas into a 2GB sql file. Now, I want to import it.
The problem is that in the examples I've seen so far, the commands are for each mode:
mysql -h hostname -u user database < path/to/test.sql
My file contains many tables from multiple schemas.
How to run? It's too large to paste into Mysql Workbench, or run from a program.
Three choices:
Contains the
USE <schema>
statement a> in the SQL input file, before other statements that reference tables in the schema.Use to qualify the table name. You can then reference the table in any schema, regardless of which schema is the default.
Split the input file into multiple files, one file for each pattern. Run each of these multiple files using a different invocation of the
mysql
command line tool, passing the corresponding schema name as argument.