Skip to content

Instantly share code, notes, and snippets.

@Rusydy
Created November 13, 2025 13:50
Show Gist options
  • Select an option

  • Save Rusydy/967a39f60c142a6e66076a8bc9bfc2c7 to your computer and use it in GitHub Desktop.

Select an option

Save Rusydy/967a39f60c142a6e66076a8bc9bfc2c7 to your computer and use it in GitHub Desktop.
# send SQL files from Mac to the VM
# On Mac, set password environment variable
export MYSQL_PWD=password123
export MYSQL_USER=dev
export MYSQL_DB=database
export MYSQL_HOST=100.100.100.10
export MYSQL_SSL_MODE=DISABLED
# Run import without -p flag
for file in *.sql; do
echo "Importing $file..."
mysql -h $MYSQL_HOST -u $MYSQL_USER --ssl-mode=$MYSQL_SSL_MODE $MYSQL_DB < "$file"
done
# Unset the variable when done (for security)
unset MYSQL_PWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment