1

I try to load an SQL dump into a MySQL database.

The dump contains a .sql file which creates all tables in the database. Along with the .sql file, there are tab separated .txt.gz files with the data for the tables. The file name matches the table name and the file contains no headers.

  • database.sql
  • table1.txt.gz
  • table2.txt.gz
  • table3.txt.gz
  • ...

Question: Was this created with a standard dump tool? Is this a standard database dump format? Can load this with e.g. mysql, mysqldump or something similar?

I know of course that I can iterate the files and load them one by one.

The data comes from: ftp://ftp.ensembl.org/pub/grch37/release-94/mysql/homo_sapiens_core_94_37/

Martin Preusse
  • 8,340
  • 8
  • 43
  • 73
  • This can be done "manually" in Mysql Workbench. When you `SELECT *` you can export the result in many differents format. Text/CSV has only datas (fields names too) – Cid Oct 18 '18 at 09:01
  • This looks like the output of `select * from tablename into outfile 'filename'` (if it came from mysql - the source might be something else, which could explain why it's not a normal mysqldump). The in-mysql reverse operation is [`load data infile`](https://stackoverflow.com/q/14127529/6248528), but there are also numerous other tools that allow you to import csv files. If the filenames match the tablenames and the column order, you can probably create a simple batch for this and loop through all files, but maybe one of the files in that folder contains a script to import the data that way. – Solarflare Oct 18 '18 at 09:27

0 Answers0