MySQLdump no data export

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

+4
source share
2 answers

By default, mysqldump exports data - you must use the -no-data flag to make it only an export structure. Since your IS does this by default, this means that "no-data" is installed in your MySQL settings file, which you can find below these directions .

+10
source

I had the same problem. re-run the dump command with '-databases' as follows:

mysqldump -u user -pxxxxx --databases site_DB . . . . 
+1
source

All Articles