Skip to content

Instantly share code, notes, and snippets.

@zckkte
Created July 11, 2023 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zckkte/d58b0366c509b1459615393d048ae62e to your computer and use it in GitHub Desktop.
Save zckkte/d58b0366c509b1459615393d048ae62e to your computer and use it in GitHub Desktop.
# export mysql database
mysqldump -u username -p database_name > data-dump.sql
# Check if a sql script is a legit sql dump file
head -n 5 prodbck_anon_reduced.sql | grep dump ; echo $?
# import
mysql -u root -p
CREATE DATABASE new_database;
mysql -u username -p new_database < data-dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment