maderic_m
maderic_m

Reputation: 73

MySQLdump no data export

I want to do a mysqldump with the table definition and table data every day, for this I config a cron job with this comand: "mysqldump -u user -pxxxxx site_DB | gzip > backup/site/site_t_$(date | awk {'print $1""$2""$3"_"$4'}).sql.gz" but this only export the table definition. What is the correct command to export the data? Thanks

Upvotes: 4

Views: 8462

Answers (2)

ZacSaeed
ZacSaeed

Reputation: 191

I was having the same issue. re-run the dump command with '--databases' as follows:

mysqldump -u user -pxxxxx --databases site_DB . . . . 

Upvotes: 1

David Fells
David Fells

Reputation: 6798

By default mysqldump exports data too - you have to use the --no-data flag to make it only export structure. Since yours IS doing it by default, that means "no-data" is set in your a MySQL options file, which you can find following these directions.

Upvotes: 10

Related Questions