Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Dump a specific table or few rows (MySQL)

The 'mysqldump' command is used to Dump databases managed by MySQL. Let's consider three the most useful cases of MySQL database dumping.

  1. The simplest case is the whole database dumping:

  2. Sometimes, there's a need to dump a single table from your database. You can do it in the next way:

    1
    
    mysqldump -u username -ppassword database_name table_name > single_table_dump.sql
    

    You can also specify several tables separated by whitespace to dump these tables only.

  3. If you want to dump only rows that meet a specific criteria, you can add 'where' option to your mysqldump command. For example, dump only rows where date_created is today:

    1
    
    mysqldump -u username -ppassword database_name table_name --where="date_created='2013-06-25'" > few_rows_dump.sql
    


This post first appeared on Programming | SysGears - Custom Software, please read the originial post: here

Share the post

Dump a specific table or few rows (MySQL)

×

Subscribe to Programming | Sysgears - Custom Software

Get updates delivered right to your inbox!

Thank you for your subscription

×