Skip to content

Instantly share code, notes, and snippets.

@evgv
Created April 7, 2016 15:12
Show Gist options
  • Save evgv/adcb4eaa731de0affeea421c149ac8c8 to your computer and use it in GitHub Desktop.
Save evgv/adcb4eaa731de0affeea421c149ac8c8 to your computer and use it in GitHub Desktop.
SQL. Cli db import.
  // Import sql file
  mysql -h HOST --port=3307 -p -u  USER DATABASE < FILE
  
  // example
  mysql -h localhost --port=3307 -p -u root main < main_dump.sql
  
  
  // Import archive
  gunzip < FILE | mysql -h HOST --port=3307 -p -u USER DATABASE
  
  // example
  gunzip < main_dump.gz | mysql -h localhost --port=3307 -p -u root main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment