Skip to content

Instantly share code, notes, and snippets.

@namklabs
Last active January 23, 2018 04:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namklabs/2206509 to your computer and use it in GitHub Desktop.
Save namklabs/2206509 to your computer and use it in GitHub Desktop.
database.mysql file import via command line
REM These commands allow you to dump a mysql database or import a database that is too large to be uploaded via PHPmyAdmin.
REM If importing, you should put your .sql file in your mysql bin dir ( for wamp: C:\wamp\bin\mysql\mysql15.5.20\bin\ )
REM If exporting, the mysql bin dir is where the exported file will show up.
REM export a mysql database
REM wamp's username is root, does not have a password
mysqldump -u username -p password(optional) databasename > databasename.sql
REM import a mysql database
mysql -u username -ppassword databasename < databasename.sql
REM notice how there is no space after the -p switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment