File README.SUSE of Package mysql-backupscript
Hi
This is a very simple backup script for your mysql database.
This script expects a file /root/.my.cnf containing at least
the following information:
--------------------------[snip]
[client]
user = root
password = <password>
# in case you want to backup from a remote MySQL/MariaDB
# machine, please fill in the 'host' (and port) here:
# host = remotehost
# port = 3306
# the example below increases the maximum allowed packet
# size during the dump to 512M (for huge tables)
#[mysqldump]
#max-allowed-packet = 536870912
--------------------------[snap]
The file should be read/writeable only for root
(-rw------- permissions).
(Note: you won't run a mysql server without a password set for
your administrator account!
Try "mysql_secure_installation" to secure your
installation.)
Afterwards, configure your database backup via YaST2 ->
/etc/sysconfig-Editor or edit /etc/sysconfig/mysql-backupscript
directly with your preferred editor.
= Restore =
To restore, simply 'cd' into the backup directory of your
choice (configured in /etc/sysconfig/mysql-backupscript),
'bunzip2' or 'xz -d' the database file you want to
restore and run:
mysql < $dbfile
That's it. The script also copies your /etc/my.cnf and
/etc/my.cnf.d/*.cnf files away, so you have something at
hand if you played too much with the settings there ;-)
Have a lot of fun!