0

Is there a way how to split up dump of whole database server (with such tables as 'mysql' or 'information_schema') to single databases?

Looking for better way than insert this whole dump and export needed databases...

Need to recover only part of this dump (only single databases)

Marek Sebera
  • 271
  • 3
  • 16

2 Answers2

3

try this:

awk '/USE `/{i++}{print > "file."i".sql"}' yourFullMysqlDump.sql

it'll create file.X.sql for each of the databases

pQd
  • 29,981
  • 6
  • 66
  • 109
2

Dump is a text file, so just open in in text editor and extract the part you need.

Kruno
  • 46
  • 2