LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mysqldump - backup *.* (https://www.linuxquestions.org/questions/linux-newbie-8/mysqldump-backup-%2A-%2A-163904/)

bpk 03-29-2004 04:20 PM

mysqldump - backup *.*
 
Code:

mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| discuss  |
| mysql    |
| test    |
+----------+

I'd like to back up all three of those. As a matter of fact. I'd like to back them all up in such a a way that I can drop this dump right back into a mySQL server if this one shall ever fail. I have looked at the online docs and man and have decided that this seems to be what i want:

Code:

mysqldump -opt -Aa > mysqldump.sql
Is this sane or is there a better practiced method? the "A" means all databases and the "a" means Include all MySQL specific create options.

jsokko 03-29-2004 04:42 PM

Two ways of doing this:

1. Copy your whole data dir in /usr/lib (OR local)/mysql by hand or script (tarballing it or cp or mv or desktop mgr Copy / Paste)

2. or use mysqldump to export all DBs into INSERT SQL files (with data of course) like mysqldump --opt [DBname] > [/file/path/][fileName].sql

As for using dump for ALL DBs, I haven't tried it but hey, why not? :) I'd try it after tarballing the data dir JIC.


All times are GMT -5. The time now is 09:49 AM.