Difference between revisions of "Mysqldump"

From wikieduonline
Jump to navigation Jump to search
 
Line 4: Line 4:
 
  [[mysqldump --help]]
 
  [[mysqldump --help]]
 
  [[mysqldump --single-transaction]]
 
  [[mysqldump --single-transaction]]
 +
[[mysqldump --skip-lock-tables]]
  
 
== Create backup ==
 
== Create backup ==

Latest revision as of 06:34, 9 June 2024

mysqldump[1] a backup program.

mysqldump --help
mysqldump --single-transaction
mysqldump --skip-lock-tables

Create backup[edit]

  • mysqldump DB_name > DB_name.sql
    • Compressing from stdin
      • mysqldump DB_name | gzip > DB_name.sql.gz
      • mysqldump DB_name | xz -T0 > DB_name.sql.xz
  • mysqldump -u root -p --all-databases

Restore backup[edit]

create database DB_name;
mysql -u root -p DB_name < /path/to/file/DB_name.sql

Related[edit]

set -o pipefail
mysqldump [...] | restic -r /srv/restic-repo backup --stdin

Activities[edit]

See also[edit]

  • https://linux.die.net/man/1/mysqldump
  • Advertising: