MYSQL:Scripts for MYSQL Databases hotbackuup

MYSQL Databases backup


MYSQL provide the utility for hot backup that can be done by mysqldump

1.For Backup of single database in shell script

/usr/local/mysql/bin/mysqldump  -uroot -ppass --log-error=/mysql2/mysqlbackup/db_name_`date +"%d-%m-%y"`.log DBNAME --routines >/mysql2/mysqlbackup/DBNAME_`date +"%d-%m-%y"`.sql

2.For All MYSQL Databases backup in one single file.

/usr/local/mysql/bin/mysqldump -u root -p --log-error=/mysql2/mysqlbackup/ALL_DB_ERROR_`date+"%d-%m-%y"`.log  --all-databases --routines >/mysql2/mysqlbackup/ALL_MYSQL_DB_`date +"%d-%m-%y"`.sql

Use mysqlimport to restore backup.
 

Comments

Popular posts from this blog

Agent Installation on Windows Server. SQL Server (Failover Cluster) target addition in OEM 12c

Oracle 10g/11g Linux:SMS the alert logs ORA- errors generated in timestamp

Oracle 11g: Install Instant Client 11.2.0.3.0 on Linux x86_64 Server.