Find us on Google+ Google+

September 1, 2018

MySQL mysqldump commands

mysqldump commands in MySQL


mysqldump ==> used to take backup

mysqldump [OPTIONS] database [tables]

mysqldump -u root -psecret -e "show databases;"

mysqldump -u root --all-databases

mysqldump -u root -psecret --all-databases > all_database_dump.sql

mysqldump -u root --all-databases --single-transaction --master-data=1 > masterdump.sql

mysqldump -u search --password=secret --host=10.40.5.148 --port=3306 --add-drop-table --add-drop-database --add-locks --compress --routines --databases searchdb --result-file=master-dump-26102018.sql

mysqldump -u root -psecret --databases testdb

/usr/bin/mysqldump --user="$USERNAME" --password="$PASSWORD" --opt --flush-privileges mydb > /backup/mysql_dumps/bck_mydb_$(date +%Y%m%d-%H%M).dmp

mysqldump --user="$USERNAME" --password="$PASSWORD" --opt --force --flush-privileges mydb > /u06/mysql_dumps/bck_mydb_$(date +%Y%m%d-%H%M).dmp

# mysqldump -u username -p databasename > backup.sql 

$ mysqldump --all-databases --no-data > schema.sql

$ mysqldump --all-databases --lock-tables > mysql_backup.sql

~mysql/bin/mysql -u username -ppassword dbname --lock-all-tables --opt  < /tmp/dbname.sql

mysqldump -u root -p --opt newdatabase > newdatabase.sql

mysqldump world_db > world_db_backup.sql

mysqldump world_db city_tbl country_tbl > city_country_backup.sql

mysqldump --databases world_db testdb > world_testdb_backups.sql

mysqldump -u root -psecret --quick --databases tempdb | mysql -u linuxusr -ppass -h linux006

/usr/bin/mysqldump --login-path=localdb --all-databases --single_transaction --events --routines --triggers

mysqldump world_db city_tbl | mysql testdb # copying table from one MySQL db to another MySQL db


Related Articles:  
mysqladmin commands

1 comment:

  1. Wonderful blog. Thanks for sharing informative Post. Its very useful to me.
    Oracle Apps DBA Training in Hyderabad

    ReplyDelete