From 6083e2d70b0955c556bb3c1b2e3d25f44859e148 Mon Sep 17 00:00:00 2001 From: Amgad Suliman Date: Sun, 25 Aug 2013 11:48:19 +0400 Subject: [PATCH] More mysqldump commands. I also modified the previous commands so passwords don't show in the history. --- cheatsheets/mysqldump | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cheatsheets/mysqldump b/cheatsheets/mysqldump index 7652efa..c673e87 100644 --- a/cheatsheets/mysqldump +++ b/cheatsheets/mysqldump @@ -1,8 +1,14 @@ # To dump a database to a file: -mysqldump -uusername -ppassword the-database > db.sql +mysqldump -uusername -p the-database > db.sql # To dump a database to a .tgz file: -mysqldump -uusername -ppassword the-database | gzip -9 > db.sql +mysqldump -uusername -p the-database | gzip -9 > db.sql # To dump all databases to a file: -mysqldump -uusername -ppassword --all-databases > all-databases.sql +mysqldump -uusername -p --all-databases > all-databases.sql + +# To export the database structure only: +mysqldump --no-data -uusername -p the-database > dump_file + +# To export the database data only: +mysqldump --no-create-info -uusername -p the-database > dump_file \ No newline at end of file