Skip to content

Instantly share code, notes, and snippets.

@alfredbez
Created June 15, 2020 12:06
Show Gist options
  • Save alfredbez/657ecfea9801193ce0d84a40b1bf5a97 to your computer and use it in GitHub Desktop.
Save alfredbez/657ecfea9801193ce0d84a40b1bf5a97 to your computer and use it in GitHub Desktop.
Dumps a oxid database without the views
# Replace DBUSER & DBNAME before running this
mysqldump \
-uDBUSER \
-p \
DBNAME \
--lock-tables=false \
$(mysql \
-uDBUSER \
-p \
DBNAME \
-Ne"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='DBNAME' AND TABLE_TYPE='BASE TABLE' " \
) \
| gzip > "/tmp/database-dump.sql.gz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment