1

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?

7
  • 1
    What you get is not a dump of "some file", but an explanation of how to use the command! Read it! Commented Nov 19, 2013 at 12:08
  • Not sure about MS-Windows (as most others here I don't use it), but usually there must be a space between an option identifier and its argument like this: mysql –u root –p admin ..... This might be different on MS-Windows compared to all other systems, but give it a try. Commented Nov 19, 2013 at 12:10
  • @arkascha It is not necessary to have a space between the options you have mentioned. Commented Nov 19, 2013 at 12:14
  • 2
    I don't use the mysql command line, but I'm pretty sure there is no error message that says "Nothing is working". You should show us what exactly happens when you run the statements. Commented Nov 19, 2013 at 12:16
  • Thanks for the sarcasm. What do you think is the image I posted? That is what I am getting. Commented Nov 19, 2013 at 12:22

1 Answer 1

1

Try this command in command line

mysql -u username -p database_name < file.sql

Note : please provide the actual path of your sql file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.