• Home

Weekender - priceless
Resolving MAC address

Dumping MySQL, in bulk!

Got a new assignment today. I have to go thru milions line of codes for better understanding of the system that I’m suppose to customize for another client. Monday morning blues. First day of the week got a welcome task of boredom. Hmm.

Received a copy of system and an sql dump file. Fired up firefox and directly opened phpMyAdmin under import section. Pointed the dump file and press enter! Next thing I knew phpMyAdmin says file too large. WTH! Its over 25mb in plain sql. I checked. No wonder it got rejected. phpMyAdmin’s documentation say there’s a workaround of this by manipulating values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. Tried with no luck.

Later on today I bumped into BigDump, a Staggered MySQL Dump Importer. It comes in handy when replication or moving database. It is a useful tool that greatly simplified working with large databases. Used correctly, it can greatly speed importing large databases and will also assist in importing large databases hosted on remote servers where restrictions are placed on the size of databases that may be imported. This is done by breaking up one big import operation into several small sessions, reducing load on the server and avoiding file size limitations.

Currently still under beta (0.28b) but worked like charm. Setting it up is breeze. Just enter your database credential and the path of dump file. That’s it. You’re done. Here are the steps incase you miss my point.

1) Download a copy of bigdump.php, unzip the file, and open the file “bigdump.php” by right clicking it with your mouse, selecting “Open with” from the context menu and then “Notepad” from the list of applications.
2) Find the following section of the file:

// Database configuration

$db_server = 'localhost';
$db_name = 'db';
$db_username = 'root';
$db_password = 'password';

The entries should be as shown above, substituting the correct values depending on where the database that is to be imported is located. Close this file and save a copy of it to your desktop or somewhere it will be easily remembered.
3) If you are using bigdump to import a database into your localhost installation, you should place a copy of the file you just edited in your htdocs/root/www folder along with a copy of the database you intend to support. If you are importing the database to a remotely hosted serverl installation, you will need to transfer copies of the database and the bigdump.php file you edited to your server.
4) Open your web browser, select the text in the address bar, and type:
http://localhost/path-to-bigdump/bigdump.php
if you are importing to remote server and

http://www.example.com/path-to-bigdump/bigdump.php
5) Bigdump.php should run unattended after it has run, and will inform you of it’s success when the database has been completely installed.
6) If you are importing to a remote database, you should delete the bigdump.php file for security purposes with your ftp pro

gram or other utility as suggested in the bigdump.php documentation, and you may wish to remove the old database at this time as well, to free up server space.

Edited bigdump.php can be place anywhere in your site as long as you have direct access to it (and remember it) and it has permission to be executed. Just point to it and click start import.

My 25mb dump file with 10k++ lines took 2hours to be completed. Maybe yours will take less time. After all its my darn PC that is slow.

And remember to vote them at HotScripts

People who does read this, happen to read these as well.
  • I'm bluffing

Comments

  1. Quote
    Qaiyum said 10 January 2008, 8:09 pm:

    Happy Hosting !!

    Sudah Tukar Theme Baru La.. Komen La Eh.. Hehe..

  2. Quote
    apan said 12 January 2008, 3:24 am:

    MySQL adelah bende yg xbest so dinasihatkan anda di luar sane jgn mencube bende ini melain kan anda mahu diri anda tension atau sengaje mencari masalah

Leave a Comment

(required)

(required)

Formatting your Comment
(Close)

Formatting Your Comment

The following XHTML tags are available for use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

URLs are automatically converted to hyperlinks.

  • This Entry

    Feed

    This entry was written 10:09 am 7 January 2008 by zemaNORIS.

    Categorized: stumbled!, tips&tricks, work. Tagged:bigdump, dump, large, memory limit, mysql, script, sql, workaround

    There are 2 responses. Respond.

  • Twitter: rognales

    • @mkhairul never tried blueprint. currently with yui-grid. is it better/flexible? about 4 hours ago from TwitterFox
    • @ajeylia from where? 11:47:29 AM August 19, 2008 from TwitterFox
    • http://babylonad.u.com.my - watch this space tomorrow for free muvee premiere tickets - Babylon A.D. 06:56:26 PM August 14, 2008 from TwitterFox
  • Recent Comments

    • titan on Interview Questions, and I Failed
    • syam on Interview Questions, and I Failed
    • lun on Interview Questions, and I Failed
    • zaki blogjer on Interview Questions, and I Failed
    • reen on Interview Questions, and I Failed
  • Daily Thing

    • gHacks.net
    • I Love Typography
    • Raymond.CC Blog
    • Smashing Magazine
    • TechieQuest
    • TechMixer
    • The Big Noob
  • Fellow Side Kick

    • Mixterr Studio Blog
    • MKhairul
    • Mohd Ismail
    • Qaiyum
  • Who Does This?

    • Noris!
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Powered by WordPress & Fauna

Feed Entries     Feed Comments