ClanKiller.com
http://forums.clankiller.com/

PhpMySqlDump
http://forums.clankiller.com/viewtopic.php?f=24&t=3503
Page 1 of 1

Author:  Satis [ Tue Apr 20, 2010 1:45 pm ]
Post subject:  PhpMySqlDump

I wrote a script in php that will take your supplied credentials (servername, username, password, database name) and then automagically get all the tables, let you select the ones you want dumped, then dump them all via ajax into sql files using mysqldump. This is mainly meant for databases that are so big that dumping them all at once via phpmyadmin or something doesn't work. You can then download the sql files for each table and import them individually, or merge them if you feel inclined.

This is currently version 0.1a. There are no doubt bugs in here, but I tested it both locally and in my web space and it works as far as I can tell.

There are a few caveats
1. I do rapid-fire AJAX requests... from Firebug, it looks like the requests are getting stuck in a firing state. I actually do get returns, though, so it's possible that it's a problem with Firebug and not anything actually wrong with the script.
2. This is only tested in Firefox. It may not work in other browsers... but it should. I'll test it more later.
3. Table dumps are done sequentially. IE, one table dumps until it's done, then the next one goes. I coded it with the idea of simultaneously dumping multiple tables, so I'll be adding that functionality later. That should significantly reduce execution time.
4. To keep everything in a single file, I put the css and javascript into the php class. That makes for some dirty sections of code, but it keeps the whole thing confined to a single script. I think that is a worthy trade off and shouldn't affect anyone but those people interested in altering it.
5. This requires php5. It will not work on older version of php.

Author:  Satis [ Wed Apr 21, 2010 8:24 am ]
Post subject:  Re: MySQL dump script

updated to version 0.2

changelog:
21 April 2010
Added simultaneous dumping of 3 tables
Changed name of script
Altered writing to update table to be synchronous so simultaneous writes don't lock the browser up
On successful dump, the table name in the "tables to dump" table now becomes the download link
If a second dump request is made after a table was successfully dumped, the table parser strips off the previous link
Any existing file is now unlinked before being redumped
Progress Messages dialog improved
Incremented version to v0.2

Author:  Satis [ Fri Apr 23, 2010 9:20 am ]
Post subject:  Re: PhpMySqlDump

updated version 0.3

changelog:
Added scrolling to progress messages
Clear progress messages every time dump is clicked
On file dump failure, unlink any existing file
Added gzip support and detection

Author:  Rinox [ Sat Apr 24, 2010 1:21 pm ]
Post subject:  Re: PhpMySqlDump

Every other word of your previous 3 posts means nothing to me, H00M4N!!

(ie: has no idea what you're saying)

Author:  Peltz [ Sun Apr 25, 2010 1:53 am ]
Post subject:  Re: PhpMySqlDump

Hushhh, Satis is skynets henchman. :D

Author:  Satis [ Sun Apr 25, 2010 1:12 pm ]
Post subject:  Re: PhpMySqlDump

heh...this thread may not be meant for you then. :roll:

For people that build websites that do stuff (ie, not static text), they usually use php. To store data, they usually put it in a database, which is usually mySql. In some cases, you database gets so big (so much data gets in it in the form of forum posts, content, comments, etc) that you can no longer back it up normally. When you try, it times out and you get nothing. This is obviously a problem.

What this script does it allow you to back up your database by dumping out one table of data at a time and doing so automatically. You just upload it to your web space, browse to it, fill out a few fields, and the rest is auto-magical. :roll:

I actually wrote this because I got into a discussion about the problem and possible solutions on my web provider's forums. I decided to leverage my knowledge of php and javascript to make something fast, powerful and adaptable. Bam! A script is born!

Questions? Comments? Bank account numbers?

Author:  Peltz [ Sun Apr 25, 2010 3:41 pm ]
Post subject:  Re: PhpMySqlDump

Quote:
Questions? Comments? Bank account numbers?


Why, you want to transfer me some money, hey i'm down with that!

Author:  Rinox [ Mon Apr 26, 2010 1:25 am ]
Post subject:  Re: PhpMySqlDump

So...you're gonna sell the script to MS and become the new Bill Gates/Steve Allen? :wink:

I'll have your social security number too if you're offering anyway.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/