Skip to content

Instantly share code, notes, and snippets.

@Lukas238
Created September 2, 2021 15:12
Show Gist options
  • Save Lukas238/6c8e63ddb04b685946d47c3bb0638098 to your computer and use it in GitHub Desktop.
Save Lukas238/6c8e63ddb04b685946d47c3bb0638098 to your computer and use it in GitHub Desktop.
Script to make a DataBase dump to file, without comments.
#!/bin/bash
# This script will dump the DB to file.
# Replace DB_USER, DB_PASS, and DB_NAME with your data base user, password and name.
# Mind the lack of gap apfter the `-p` argument. :)
# To run it use `sh do_backup.sh`
mysqldump -u DB_USER -pDB_PASS DB_NAME --skip-comments --host localhost > db_backup/db_backup.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment