LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   backing up MySQL dbase (https://www.linuxquestions.org/questions/linux-software-2/backing-up-mysql-dbase-143258/)

DropHit 02-07-2004 04:23 AM

backing up MySQL dbase
 
OK i have tried a few different ways to back up all of mysql databses

First was a script run from cron it owrked fine for a while then i ran into a table corruption problem. Basically i gather that somone was making an update via one of our websites, and the dump was happening at the same time.

So itried the webmin backup and the same thing has happened.

So the big question is how to doit?

Z

ugge 02-07-2004 05:10 AM

It seems as though mysqldump has an option to lock your tables for read on all tables. Might be what your looking for.

DropHit 02-07-2004 05:51 AM

Hum yeah maybe...
 
Yeah that seems right, alhtough i am trying the mysqlhotcopy now seems ALOT faster anyway although i am unsure how to recover using the files that mysqlhotcopy creates, any insight onthis?

Z

ugge 02-07-2004 06:18 AM

No, sorry!
The once I have seen have dumped it to sql files. Then you could just run them as a SQL batch job.

DropHit 02-07-2004 04:11 PM

Hum ok
 
Well ok i guess it should be easy since it made backups of everything, yeah i could also go back to using the mysqldump with the lock command, although it is REALLY slow since my dbase os around 100 mg the hotcopy takes about 9 secs and is done!!

Z

Nnyan 05-04-2004 03:19 PM

Use the -opt command which is the same as specifying
--add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset

The -quick command really speeds up mysqldump.


Heres a snippet of the shell script i'm using:

/usr/local/mysql/bin/mysqldump --flush-logs --opt -u SQLUSER -pSQLPWD dbname > /dir1/dir2/dir3/backup.sql


All times are GMT -5. The time now is 12:25 AM.