Mysql Database backup & restore command

Mysql single database backup:-

mysqldump –force –opt –single-transaction –lock-tables=false –skip-events –user=root –password=xxxx –routines –databases testdb > singledb.sql

Mysql all database backup:-

mysqldump –force –opt –single-transaction –lock-tables=false –skip-events –user=root –password=xxxx –routines –all-databases > all_databases.sql

Mysql Restore database:

mysql -u root -predhat dbname < /mnt/dbname.sql


Categories

Leave a Reply

Your email address will not be published. Required fields are marked *