Thursday, December 12, 2013

Import large database from command line in windows

Import large database from command line in windows

Use
gzip -d [DATABASE_FILE.SQL.GZ]
to unzip .sql.gz 

If you are in the command prompt, type there
CD C:\wamp\bin\mysql\mysql5.1.36\bin {you can replace mysql5.1.36 with your version of mysql}
mysql -u [DATABASE_USERNAME] -p [DATABASE_NAME] < [DATABASE_FILE.SQL]


From the mysql console:
mysql> use DATABASE_NAME;
mysql> source path/to/file.sql;