mirror of https://github.com/CrimsonTome/tldr.git
harmonize mysqldump examples
- always use `-p` for password - use short hand syntax for restoring a database (like the one used for restoring all databases)client-spec/clarity
parent
d90bdb3ba1
commit
536a64ea1c
|
@ -5,11 +5,11 @@
|
||||||
|
|
||||||
- Create a backup, user will be prompted for a password:
|
- Create a backup, user will be prompted for a password:
|
||||||
|
|
||||||
`mysqldump -u {{user}} --password {{database_name}} -r {{filename.sql}}`
|
`mysqldump -u {{user}} -p {{database_name}} -r {{filename.sql}}`
|
||||||
|
|
||||||
- Restore a backup, user will be prompted for a password:
|
- Restore a backup, user will be prompted for a password:
|
||||||
|
|
||||||
`mysql -u {{user}} --password -e "source {{filename.sql}}" {{database_name}}`
|
`mysql -u {{user}} -p {{database_name}} < {{filename.sql}}`
|
||||||
|
|
||||||
- Backup all databases redirecting the output to a file (user will be prompted for a password):
|
- Backup all databases redirecting the output to a file (user will be prompted for a password):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue