tags:

views:

45

answers:

3
mysqldump --host=localhost --user=root --password=sysadmin --no-data test > "C:\test1\ttt.dump";

This the command that i fire to create dump from mysql database , that's working fine and create dump with no data.

but I want some table with data , this command create dump with table that all are blank.

+1  A: 

You can create dump of whole db using this command

     mysqldump -uUserName -pPassword --add-drop-database --add-drop-table --hex-blob SchemaName > FileName.sql

Just enter proper UserName,Password SchemaName and filename.

Rupeshit
A: 

There is no possibility to do it with 1 command, but theres a way to get creative.

  1. Dump the database without data
  2. Dump only the tables you want with data

Now you have 2 options:

  • Open the second dumpfile in editor and use find/replace option to replace CREATE TABLE with CREATE TABLE IF NOT EXISTS or
  • When importing the second file with data use a --force option when importing the dump file
Imre L
+2  A: 

Removing the no-data switch would be a wild guess of mine.

Bobby