简体   繁体   中英

MySQL mysqldump.exe is only backing up schemes

I have this command which is only creating statements to re-create the database and schemes, but it's not backing up any of the data:

"C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.6\mysqldump.exe" --user=myuser --password=mypassword  --host=localhost --port=3306 --result-file="Z:\mysql-backup\backup.%date:~10,4%%date:~7,2%%date:~4,2%.sql" --default-character-set=utf8 --single-transaction=TRUE --databases "wpzb" "wptt"

What am I missing?

With the basic command:

mysqldump -u myuser -pmypassword --databases wpzb watt > dump_file.sql

You should get all the data and schema in one file

It might be best to execute the command for each database separately:

mysqldump -u myuser -pmypassword --default-character-set=utf8 --single-transaction=TRUE  wpzb > wpzb_dump_file.sql

This way you have the schema and data for one database in one file!

Since the database is local and on the default port you can just use:

-u myuser -pmypassword 

And leave the localhost and port attributes off.

I tested with no-data=true in the my.ini file on Windows and running mysqldump now dumps no data.

my.ini

[client]
no-data=true
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM