Created
November 15, 2020 16:02
-
-
Save vuthaihoc/60216e1c41f01b4fa2131e2d6915c667 to your computer and use it in GitHub Desktop.
Dump DB with mysql info from .env file (laravel)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export $(cat current/.env | sed 's/#.*//g' | xargs) | |
export MYSQL_PWD=$DB_PASSWORD | |
mysqldump -u $DB_USERNAME $DB_DATABASE \ | |
--no-tablespaces \ | |
--verbose \ | |
--result-file $DB_DATABASE.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment