Skip to content

Instantly share code, notes, and snippets.

@iamucil
Created September 27, 2021 08:59
Show Gist options
  • Save iamucil/ce3834e19fab68db83c9bf8e6d49868b to your computer and use it in GitHub Desktop.
Save iamucil/ce3834e19fab68db83c9bf8e6d49868b to your computer and use it in GitHub Desktop.

Run SQL script in maria/mysql db container

Run this script from your local machine,

docker exec -i CONTAINER_ID sh -c \
	'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" YOUR_DATABASE' \
	< your_file.sql 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment