Skip to content

Instantly share code, notes, and snippets.

@rana01645
Created September 30, 2020 18:17
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 rana01645/ea5350cfb6f966036f308f56c6e986d7 to your computer and use it in GitHub Desktop.
Save rana01645/ea5350cfb6f966036f308f56c6e986d7 to your computer and use it in GitHub Desktop.
import db to remote mysql
DB_HOST=1.2.3.4
DB_PORT=3306
DB_DATABASE=db_name
DB_PASSWORD='password'
DB_USERNAME=username
pv -f db.sql | mysql -f -h ${DB_HOST} --port=${DB_PORT} -u${DB_USERNAME} -p${DB_PASSWORD} ${DB_DATABASE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment