Good morning Andreas -

The --opt flag implies --extended-insert, in addition to some other
options, to generate an optimized (fast) dump file.  See man
mysqldump.  You don't need both but having both shouldn't hurt.

To restore, pipe your dump file back into the mysql client, a la
mysql -u user -ppassword -D database < db_dump20060330

Keep in mind that one dump file may contain data for multiple
databases depending on how you have things set up.  Not really a
problem until you want to restore just one database or just one table
- then you have to get creative.

Dan

On 6/30/06, Andreas Widerøe Andersen <[EMAIL PROTECTED]> wrote:
I finally got the script working. Seems to run smooth on my FreeBSD 4.11system:

MYSQLDUMP="`which mysqldump 2>/dev/null`" ||
MYSQLDUMP="/usr/local/bin/mysqldump"
MYSQLDUMP_ARGS="--opt --extended-insert -h localhost -umyuser -pmypassword
mydb"
ARCHDIR=/backup/mysql
NAME=db_dump

# Remove archives older than 64 days
find ${ARCHDIR} -type f -mtime +64 | xargs rm -f
# Create new archives
cd ${ARCHDIR} && ${MYSQLDUMP} ${MYSQLDUMP_ARGS} > ${NAME}.`date +%Y%m%d`

I just have two more questions:

Should I use --extended-insert or not? I guess I can use both, but what is
recommended?

What would the correct script/way to restore the database?

Thanks,
Andreas



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to