James Satori-Brunet
James Satori-Brunet

Reputation: 901

Can't import sql file through command line

I am trying to import an sql file through the commmand line in Windows 7 with no luck. I know there are other questions on here that deal with this but NOTHING in any of the answers has helped me.

The file is too large for a PHPMyAdmin import. It is a 500mb post code file.

I have tried various different methods to connect and/or import:

C:\xampp\mysql\bin\mysql.exe -uroot –padmin postcodetest < C:\fullukpostcodes.sql

C:\xampp\mysql\bin\mysql –uroot –padmin postcodetest < C:\fullukpostcodes.sql

mysql> use postcodetest;
mysql> source C:\fullukpostcodes.sql;

Nothing is working. All that is happening is that I am getting a dump of some file (maybe PHP.ini).

enter image description here

Please help. What am I doing wrong?

Upvotes: 1

Views: 1285

Answers (1)

Kamal Kishor
Kamal Kishor

Reputation: 69

Try this command in command line

mysql -u username -p database_name < file.sql

Note : please provide the actual path of your sql file

Upvotes: 1

Related Questions