Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import SQL file by command line in Windows 7

I want to import an SQL file (size > 500MB) into a 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 it does not work for me. So I want to import it by command line.

I used these commands for import the 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.

like image 280
Napster Avatar asked Feb 13 '13 05:02

Napster


1 Answers

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/

like image 167
user2001117 Avatar answered Oct 09 '22 07:10

user2001117