Tags: mysql,bash,backup,données
Sort by: Date /
Title /
-
#!/bin/bash
prefixe=backup
suffixe=$(date +%Y%m%d)
filename=$prefixe$suffixe.sql
host=host
database=database
user=user
characterSet=UTF8
mysqldump --skip-comments \
--complete-insert \
--default-character-set=$characterSet \
--no-create-info \
--skip-add-locks \
--skip-opt \
--host $host \
--user $user \
-p $database > $filename
sed -i "1iuse $database;\nSET CHARACTER SET '$characterSet';" $filename
exit 0
First / Previous / Next / Last / Page 1 of 1 (1 posteets)