Difference between revisions of "Mysqldump"
Jump to navigation
Jump to search
↑ https://linux.die.net/man/1/mysqldump
Tags: Mobile web edit, Mobile edit |
|||
(27 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{lc}} | ||
<code>mysqldump</code><ref>https://linux.die.net/man/1/mysqldump</ref> a [[backup]] program. | <code>mysqldump</code><ref>https://linux.die.net/man/1/mysqldump</ref> a [[backup]] program. | ||
+ | [[mysqldump --help]] | ||
+ | [[mysqldump --single-transaction]] | ||
+ | [[mysqldump --skip-lock-tables]] | ||
− | == | + | == Create backup == |
− | * <code>mysqldump | + | * <code>mysqldump DB_name > DB_name.sql</code> |
− | ** Compressing from <code>[[stdin]]</code> <code>mysqldump | + | ** Compressing from <code>[[stdin]]</code> |
− | ** | + | *** <code>mysqldump DB_name | [[gzip]] > DB_name.sql.gz</code> |
+ | *** <code>mysqldump DB_name | [[xz -T0]] > DB_name.sql.xz</code> | ||
− | == Related | + | * <code>mysqldump -u root -p --all-databases</code> |
+ | |||
+ | * <code>mysqldump -u root -ppassword [[--flush-logs]] [[--delete-master-logs]] [[--all-databases]] > full-backup.sql</code> | ||
+ | |||
+ | == Restore backup == | ||
+ | [[create database]] DB_name; | ||
+ | mysql -u root -p DB_name < /path/to/file/DB_name.sql | ||
+ | |||
+ | == Related == | ||
* <code>[[mongodump]]</code> | * <code>[[mongodump]]</code> | ||
− | * <code>[[mariabackup]]<code> | + | * <code>[[pg_dump]]</code> |
+ | * <code>[[mariabackup]]</code> (since 2017) | ||
+ | * <code>[[mysql]]</code> | ||
+ | * <code>[[mysqldumpslow]]</code> | ||
+ | * [[Snapshot]] | ||
+ | * <code>[[--single-transaction]]</code> | ||
+ | |||
+ | [[set -o pipefail]] | ||
+ | mysqldump [...] | restic -r /srv/restic-repo backup --stdin | ||
+ | |||
+ | == Activities == | ||
+ | * Read https://stackoverflow.com/questions/104612/run-mysqldump-without-locking-tables | ||
== See also == | == See also == | ||
+ | * {{mysqldump}} | ||
* {{MariaDB}} | * {{MariaDB}} | ||
+ | * {{MySQL}} | ||
* [[XtraBackup]] and [[MyDumper]] | * [[XtraBackup]] and [[MyDumper]] | ||
* {{dbdump}} | * {{dbdump}} | ||
+ | |||
[[Category:Databases]] | [[Category:Databases]] | ||
[[Category:Backup]] | [[Category: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
mysqldump -u root -p --all-databases
mysqldump -u root -ppassword --flush-logs --delete-master-logs --all-databases > full-backup.sql
Restore backup[edit]
create database DB_name; mysql -u root -p DB_name < /path/to/file/DB_name.sql
Related[edit]
mongodump
pg_dump
mariabackup
(since 2017)mysql
mysqldumpslow
- Snapshot
--single-transaction
set -o pipefail mysqldump [...] | restic -r /srv/restic-repo backup --stdin
Activities[edit]
See also[edit]
mysqldump [ --single-transaction ]
- MariaDB:
mariadbcheck
,mariabackup
,mysqldump
, MyRocks,show (MariaDB)
MariaDB Changelog,50-server.cnf
, MariaDB engines, .ibd, .myd, .myi,/var/log/mysql/error.log, /var/log/mysql/mariadb-slow.log
, MariaDB files:.frm
,.ibd
,/etc/mysql/mariadb.conf.d/50-server.cnf
, replication, MariaDB slow queries,show databases;
, Aria, MyISAM, MariaDB SkySQL, binary log, 3306,/etc/mysql/
- MySQL,
mysqldump, mysqladmin
, XtraBackup, MySQL Enterprise Backup, MyISAM,/var/log/mysql/
, MySQL Workbench, Adminer,ib_logfile0, mysqld --help --verbose
, MySQL versions - XtraBackup and MyDumper
- MongoDB:
mongodump
, PostgreSQL:pg_dump
, MariaDB: mysqldump
Advertising: