Backup and Restore in Mysql

Backup and Restore is the primary goal of a DBA. Here i am explaining about the full backup in MySQL.

Step 1: Deciding which Database should backup.Here i am going to take  a backup of  Database test.

ShowDatabases

Step 2: To take Mysql backup u have to use Mysqldump.Here i used gizp to zip the file.

mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz]

backup1

Step 4 : Restoring  this testbak .sql to backuptest database.

gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

restore

Step 7 : Now look the backuptest Database where the sql file is restored.Table varun is restored.

showrestore