As long as your queries are in the correct order, you can execute as many statements at once as you want. Doesn't matter if you paste them all into a terminal connection or a GUI or import them from a command line. It's also a great way to hose things pretty badly if you make a mistake.
Moving your data from one database installation to another is fairly simple, and commonly done this way:
https://mariadb.com/kb/en/library/mysqldump/