How to import MySQL db and skip tables if you could not exclude when dumping

I have a decent size (2.6g) sql file. I cannot get a dump by excluding tables because this happens in production, and our hosting users do not want us to dump because it blocks db files. They replicated the database and provided me with an sql file, and I searched to see if there was a way to ignore the tables so that I could leave very large tables. I do not need them, since I have local data, and they are not the reason for the need for backup.

I don't want to import this into another db and do anything with it, because the whole purpose of what I'm looking for is a quick way to import data. It is required to import 2.6 concerts forever.

Going through a file and editing tables that I don't need seems to take a lot of time. My assumption is that there is no way to do this, but I decided that I would publish and take a look.

+6
source share
1 answer

You need to analyze the dump files to capture only the tables you need. Here is a pretty decent script that does this pretty well:

http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script

+2
source

Source: https://habr.com/ru/post/905646/


All Articles