Napster Napster - 4 months ago 26
SQL Question

import sql file by command line in windows 7

I want to import sql file(size > 500MB) to database .I have wamp on my pc. Phpmyadmin does not work well with this size. I changed all parameters in php.ini (max_upload_size etc.). But not works for me. So i want to import it by command line.

I used these commands for import file

mysql -u root -p sysdat < D:\Nisarg\ISPC\Database\sysdat.sql
mysql -u root -p -D sysdat < D:\Nisarg\ISPC\Database\sysdat.sql
mysql -u root sysdat < D:\Nisarg\ISPC\Database\sysdat.sql -p


these all are not working.

Plz help me for this issue.

Answer

Try like this:

I think you need to use the full path at the command line, something like this, perhaps:

C:\xampp\mysql\bin\mysql -u {username} -p {databasename} < file_name.sql

Refer this link also:

http://www.ryantetek.com/2011/09/importing-large-sql-files-through-command-line-when-using-phpmyadminxampp/

Comments