Created
November 13, 2025 13:50
-
-
Save Rusydy/967a39f60c142a6e66076a8bc9bfc2c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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