How do I delete the output for one big table inside a mysqldump with lots of tables in it?
I have a dump of a database that is 6 GB large, but 90% of it is only one logg
you need to find the create table statement of your table, and find the next create table statement. say they are n1 and n2.
then you can just delete them with sed as above. sed 'n1,n2d' dump.sql > new.sql
you can just grep create table and note the line numbers for your prework.
here is a demo.
ubuntu@ubuntu:~$ grep -n [34] a.txt
3:3
4:4
ubuntu@ubuntu:~$ cat a.txt
1
2
3
4
5
6
ubuntu@ubuntu:~$ grep [34] a.txt
3
4
ubuntu@ubuntu:~$ sed '3,4d' a.txt > b.txt
ubuntu@ubuntu:~$ cat b.txt
1
2
5
6
ubuntu@ubuntu:~$