MySQL DB Splitter....

Here non-phpBB topics can be discussed.
User avatar
Krank
Member
Member
Posts: 90
Joined: 28 Sep 2006, 21:25
Location: Somewhere

MySQL DB Splitter....

Postby Krank » 27 Jun 2007, 17:31

Guys I need your help with something, I just moved my forum, and I need an application to split my database to parts (2 MBs).
Image
phpBB3 Je t'adore: subSilver2 Based styles fan
proSilver, good, but too .... I don't know just too... :P

User avatar
igorw
Past Contributor
Past Contributor
Posts: 1967
Joined: 01 Jun 2006, 20:48
Real name: Igor

Re: MySQL DB Splitter....

Postby igorw » 27 Jun 2007, 19:11

I just spent half an hour on this...

http://phpbbmodders.net/pastebin.php?mode=view&s=21&highlight=1

This line:

Code: Select all

@ini_set('memory_limit', '50M');

is because the sql file is pretty large and will require a lot of memory. If you get a memory limit, try putting it up to 100M and close some programs. Maybe run it on a real server if your own comp is too weak.

The function call:

Code: Select all

split_sql_file('backup.sql', './sql/', pow(1024, 2) * 2);

has "pow(1024, 2) * 2" as third argument, which you could also write as "1024 * 1024 * 2". 1024 * 1024 bytes is a megabyte, so in my example it will split the files into 2 megabyte files.

Enjoy!

User avatar
Krank
Member
Member
Posts: 90
Joined: 28 Sep 2006, 21:25
Location: Somewhere

Re: MySQL DB Splitter....

Postby Krank » 27 Jun 2007, 19:29

ohhhhhhh thanks man, thanks a lot, trying it now :D
Image
phpBB3 Je t'adore: subSilver2 Based styles fan
proSilver, good, but too .... I don't know just too... :P

User avatar
MarkTheDaemon
New member
New member
Posts: 28
Joined: 23 Jun 2006, 15:41
Location: United Kingdom

Re: MySQL DB Splitter....

Postby MarkTheDaemon » 04 Jul 2007, 22:28

If you are looking to restore the database, [url=http://www.ozerov.de/bigdump.php]bigdump[/url] should work pretty well as well.


Mark
Image
Never, ever, argue with an idiot. They'll drag you down to their level and beat you with experience :P


Return to “General Discussion”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 5 guests