2,187
edits
(→Commands: Added tasksel) |
(→Backup: Added procedure) |
||
Line 277: | Line 277: | ||
=== Backup === | === Backup === | ||
Based on http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/ | Based on http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/ | ||
# Create the required folders using... | |||
#* <code> mkdir backup </code> | |||
#* <code> mkdir backup/mysql </code> | |||
# Create the file below (editing as required) as <code> /backup/mysql.sh </code> | |||
# Make the file executable | |||
#* <code> chmod +x /backup/mysql.sh </code> | |||
# Perform a test run of the backup | |||
# Schedule the script to run with crontab | |||
#* <code> crontab -e </code> | |||
#* <code> 30 1 * * * /bin/bash /backup/mysql.sh </code> | |||
<source lang="bash"> | <source lang="bash"> | ||
Line 341: | Line 352: | ||
fi | fi | ||
</source> | </source> | ||
In some versions of MySQL you will receive an error similar to... | |||
mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES | |||
It appears to be a [http://bugs.mysql.com/bug.php?id=21527|MySQL bug], which seems to keep cropping up. As a workaround change the <code> $MYSQLDUMP </code> line to | |||
<source lang="bash"> | |||
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS --skip-lock-tables $db | $GZIP -9 > $FILE | |||
</source> | |||
Note that you won't backup the <code> information_schema </code> table if you need to implement this workaround | |||
== Troubleshooting == | == Troubleshooting == |