It would be much faster to use bcp to dump the data, and load it into mariadb using the 'LOAD DATA INFILE' command.