Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to divide MYSQLDUMP full database backup into single library files

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to divide MYSQLDUMP full database backup into single database files. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Sometimes we do the backup of the whole library, but we need the files of a single library during the recovery. If the library we need is very small, it will be very slow and time-consuming for us to restore the backup of the full library and then export the files of the desired library.

It would be nice to be able to split the file into a single library, so I made the following tool

The tool called mysplit allows you to see the size and split files of each library that is backed up.

Download Baidu Cloud disk:

Http://pan.baidu.com/s/1mhfl6R2

After download, it is passed into the LINUX system.

Chmod 755 mysplit1.2

You can use the help as follows:

/ *

Copyright by GaoPeng .All rights reserved.Version 1.2

This tool is uesd to split more than one database dump

To split to single database file and show every datab

Ase dump size.

USEAGE:./mysplit-show/-split dumpfilename [charset]

-show to show every database dump size

-split TO split every database to single file

[charset] is optional default / * SET NAMES UTF8*/

Editer's qq:22389860,bugs report!

* * /

Use the instance to split the library:

[root@hadoop1 ~] # mysplit1.2-split log.log utf8

/ *

Copyright by GaoPeng .All rights reserved.Version 1.2

This tool is uesd to split more than one database dump

To split to single database file and show every datab

Ase dump size.

USEAGE:./mysplit-show/-split dumpfilename [charset]

-show to show every database dump size

-split TO split every database to single file

[charset] is optional default / * SET NAMES UTF8*/

Editer's qq:22389860,bugs report!

* * /

NOTE:if use-show Enter y follow hint is affect only-split

Will use charset utf8,please check!

Best way to find set names use Linux command:

Head-n 10 dumpfilename

[y/n] y:use default charset utf8/n:exit mysplit

Y

/ * 40101 SET NAMES utf8 * /

Number 1Magnum begin 778 end 908 Magi database-- g1trainsize= 0.126953 (KB)

New file is create of databse g1

Number 2 begin 909 end 1045 database-kkmm'size= 0.132812 (KB)

New file is create of databse kkmm

Number 3Magna begin 1046 Magi end 627860 Magi Database-mysql'size= 612.123047 (KB)

New file is create of databse mysql

Number 4Magna begin 627861 Magi end 628477 database-nvc'size= 0.601562 (KB)

New file is create of databse nvc

Number 5Magnum begin 628478 Die end 251621886 Magi database-test'size= 245110.750000 (KB)

New file is create of databse test

Number 6 begin 251621887 end 251622887 database-test1'size= 0.976562 (KB)

New file is create of databse test1

Number 7 ~ (nd) 25162288 ~ end 262508330 ~ test100'size= 10630.314453 (KB)

New file is create of databse test100

Number 8Magnum begin 262508331 end 262992362 test2'size= 472.686523 (KB)

New file is create of databse test2

Number 9 ~ # begin 262992363 ~ ~ end 262992505 testl2'size= 0.138672 (KB)

New file is create of databse testl2

Number 10 ~ (nd) 262992506 ~ ~ end 262992549 ~ database-- g1trainsize = 0.041992 (KB)

File is exist append to databse g1

Number 11st begin 262992550 KB end 262992597 database-kkmm'size= 0.045898 (KB)

File is exist append to databse kkmm

Number 262992598 number end 262992647 database-mysql'size= 0.047852 (KB)

File is exist append to databse mysql

Number 13st begin 262992648 nvc'size= end 262992693 nvc'size= 0.043945 (KB)

File is exist append to databse nvc

Number 14st begin 262992694 KB end 262993646 database-test'size= 0.929688 (KB)

File is exist append to databse test

Number 15penny begin 262993647 end 262994567 database-test1'size= 0.898438 (KB)

File is exist append to databse test1

Number 16Jane begin 262994568 end 262995526 test100'size= 0.935547 (KB)

File is exist append to databse test100

Number 17penny begin 262995527 end 262995576 test2'size= 0.047852 (KB)

File is exist append to databse test2

Number 18precinct begin 262995577 KB end 262996054 testl2'size= 0.465820 (KB)

File is exist append to databse testl2

UESD TIME TOTAL:

35.000000 seconds used

View the size of each library backup:

[root@hadoop1 ~] # mysplit1.2-show log.log utf8

/ *

Copyright by GaoPeng .All rights reserved.Version 1.2

This tool is uesd to split more than one database dump

To split to single database file and show every datab

Ase dump size.

USEAGE:./mysplit-show/-split dumpfilename [charset]

-show to show every database dump size

-split TO split every database to single file

[charset] is optional default / * SET NAMES UTF8*/

Editer's qq:22389860,bugs report!

* * /

NOTE:if use-show Enter y follow hint is affect only-split

Will use charset utf8,please check!

Best way to find set names use Linux command:

Head-n 10 dumpfilename

[y/n] y:use default charset utf8/n:exit mysplit

Y

/ *! 40101 SET NAMES utf8 * /; number 1 KB begin 778 month end 908 department database-g1century size = 0.126953 (KB)

Number 2 begin 909 end 1045 database-kkmm'size= 0.132812 (KB)

Number 3Magna begin 1046 Magi end 627860 Magi Database-mysql'size= 612.123047 (KB)

Number 4Magna begin 627861 Magi end 628477 database-nvc'size= 0.601562 (KB)

Number 5Magnum begin 628478 Die end 251621886 Magi database-test'size= 245110.750000 (KB)

Number 6 begin 251621887 end 251622887 database-test1'size= 0.976562 (KB)

Number 7 ~ (nd) 25162288 ~ end 262508330 ~ test100'size= 10630.314453 (KB)

Number 8Magnum begin 262508331 end 262992362 test2'size= 472.686523 (KB)

Number 9 ~ # begin 262992363 ~ ~ end 262992505 testl2'size= 0.138672 (KB)

Number 10 ~ (nd) 262992506 ~ ~ end 262992549 ~ database-- g1trainsize = 0.041992 (KB)

Number 11st begin 262992550 KB end 262992597 database-kkmm'size= 0.045898 (KB)

Number 262992598 number end 262992647 database-mysql'size= 0.047852 (KB)

Number 13st begin 262992648 nvc'size= end 262992693 nvc'size= 0.043945 (KB)

Number 14st begin 262992694 KB end 262993646 database-test'size= 0.929688 (KB)

Number 15penny begin 262993647 end 262994567 database-test1'size= 0.898438 (KB)

Number 16Jane begin 262994568 end 262995526 test100'size= 0.935547 (KB)

Number 17penny begin 262995527 end 262995576 test2'size= 0.047852 (KB)

Number 18precinct begin 262995577 KB end 262996054 testl2'size= 0.465820 (KB)

UESD TIME TOTAL:

11.000000 seconds used

In this way, we can use split files for import!

This is the end of this article on "how to divide MYSQLDUMP full database backup into single database files". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report