12
|
Backup/Restore MySQL Server
|
This chapter will describe in details how to use
DiskSave to backup your MySQL server and how you can restore your MySQL server from the database backup files.
i.
|
DiskSave must be installed onto the computer running MySQL server.
|
ii.
|
Data from MySQL server will be backed up to a temporary directory before they are sent to
DiskSave. Please make sure you have sufficient space on your computer to store these data when you run the backup job.
|
iii.
|
There must be a MySQL account can be used to connect from localhost.
Add two new MySQL accounts for DiskSave
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' -> IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost.localdomain' -> IDENTIFIED BY 'some_pass'; mysql> FLUSH PRIVILEGES;
They are superuser accounts with full privileges to do anything with a password of some_pass.
|
DiskSave will backup your MySQL server by taking the following steps:
i.
|
Run all Pre-Commands of this backup set
|
ii.
|
All database(s) selected are backed up to a temporary directory specified in its backup set
|
iii.
|
Run all Post-Commands of this backup set
|
iv.
|
Upload all backup files from the
temporary directory to an DiskSave
|
12.3
|
How to backup MySQL server
|
Please follow the instructions below to backup your MySQL server using
DiskSave:
i.
|
Open DiskSave Right click
DiskSave icon available in the system tray and choose [Open]
|
ii.
|
From the Menu, Choose [Backup Set] -> [New] -> [MySQL Backup Set] Create a backup set
|
a.
|
From the Menu, Choose [Backup Set] -> [New] -> [MySQL Backup Set]
|
c.
|
Enter the root password, the MySQL server TCP/IP port number and the path to MySQL backup utility (mysqldump)
|
d.
|
Select the database(s) to be backup
|
e.
|
Enter a temporary directory for storing the backup files before they are sent to an
DiskSave, e.g. C:\Backup\MySQL
|
g.
|
Set the encryption algorithm, encryption mode and encrypting key for this backup set (Hint: For maximum security, please select AES (Advanced Encryption Standard) Algorithm, CBC (Cipher Block Chaining) mode and use an encrypting key with more than 8 characters.)
|
a.
|
Select the backup set you want to run on the left panel and press the [Start Backup] button (►)
|
b.
|
Select [Off-site Backup Server] to start backing up your files to an
DiskSave and press the [OK] button
|
c.
|
You should get something similar to the screen shot below.
|
12.4
|
How to restore MySQL server
|
Please follow the instructions below to restore
MySQL server from DiskSave.
i.
|
Download the database backup files to be
restored from the DiskSave
Please refer to the [5.3 How to restore file] section for information on how to download backup files from
DiskSave.
|
ii.
|
Restore the database named [db_name] from the database backup file [db_name.sql]:
|
a.
|
Connect to the MySQL server
shell> mysql
|
b.
|
Create the database to be restored
mysql> CREATE DATABASE IF NOT EXISTS db_name
|
c.
|
Restore the database backup file back into the MySQL server
shell> mysql db_name < db_name.sql
|
iii.
|
Repeat the same procedure for each database to be restored to the MySQL Server.
|