How to take mysql dump and restore in linux

Backup mysql dump
mysqldump -u username -p dbname > dbname.sql

Backup mysql dump with trigger and rutines
mysqldump -u username -p --routines --triggers dbname > dbname.sql

Backup mysql dump from remote host
mysqldump -u username -p -h remotedb-server-ipaddress dbname > dbname.sql

how to restore/import mysql backup
mysql -u username -p dbname < dbbackup.sql

Share on Google Plus

About Md. Shahzad Alam

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment