Skip to content

Commit

Permalink
Mysql dump instruction updated
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Feb 5, 2020
1 parent 750a24f commit 6c70efb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mysql.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ MySQL / SQLite
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


Check tables DB engine::

SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '<database_name>';


Backup/restore mysql dump::

# create dump
Expand All @@ -38,6 +43,10 @@ Backup/restore mysql dump::
# with timestamp
mysqldump -u USER -pPASSWORD DATABASE | gzip > `date +dump.sql.%Y%m%d.%H%M%S.gz`


# IMPORTANT: Assuming you are using InnoDB tables, you should add '--single-transaction' option
mysqldump ---skip-lock-tables -single-transaction some_database > dump.sql

# restore from dump
mysql -u USER -p DATABASE < dump.sql

Expand Down

0 comments on commit 6c70efb

Please sign in to comment.