Skip to content

Commit

Permalink
mysqldump: move backup restore examples to mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
mebeim committed Mar 13, 2020
1 parent 115b1d2 commit 32558c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions pages/common/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@
- Execute SQL statements in a script file (batch file):

`mysql -e "source {{filename.sql}}" {{database_name}}`

- Restore a database from a backup (user will be prompted for a password):

`mysql --user {{user}} --password {{database_name}} < {{path/to/backup.sql}}`

- Restore all databases from a backup (user will be prompted for a password):

`mysql --user {{user}} --password < {{path/to/backup.sql}}`
8 changes: 0 additions & 8 deletions pages/common/mysqldump.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

`mysqldump --user {{user}} --password {{database_name}} -r {{path/to/file.sql}}`

- Restore a backup (user will be prompted for a password):

`mysqldump --user {{user}} --password {{database_name}} < {{path/to/file.sql}}`

- Backup all databases redirecting the output to a file (user will be prompted for a password):

`mysqldump --user {{user}} --password --all-databases > {{path/to/file.sql}}`

- Restore all databases from a backup (user will be prompted for a password):

`mysqldump --user {{user}} --password < {{path/to/file.sql}}`

0 comments on commit 32558c6

Please sign in to comment.