MySQL Backup 1.2 (MySQL 5.5+)

In the previous versions of this script you’ve had to leave the backup user password in the script, however MySQL 5.5 and above come with mysql_config_editor which allows you to store connection details in an ancryptedl file (~/.mylogin.cnf) which mysql/mysqldump/mysqladmin can use with the “–login-path=” option. For basic usage run the following, the –password prompts … [Read more…]

MySQL Backup 1.1

This is an update to the earlier MySQL backup script, with this version I’ve added the code that (assuming your backup user has sufficient rights) allows the script to get a list of all the databases on the server, exclude the MySQL internal ones and use this as the list of databases to backup. This … [Read more…]

mysqldump error – view lack rights to use them (1356)

If you get an error messages like “mysqldump: Couldn’t execute ‘SHOW FIELDS FROM `some_database`’: View ‘some_database.viewname’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (1356)” you can work around this by trying the dump as “root” or telling mysqldump to ignore the broken view by adding this … [Read more…]

MySQL Backup

This is a simple script that can be used to take backups of your MySQL databases, it can be run as a cron job and outputs enough of a log to allow you to keep track of what’s going on. There’s a few sections you’ll need to edit and an extra stage that uses rsync … [Read more…]