14

I'm having issues attempting to import a database of 195MB via the command line.

mysql -u root -p [DB_NAME] C:\Users\user_name\Downloads\file.sql

When I run this command all I receive from MySQL is a list of variables and options available.

What am I doing wrong?

Also like to add I'm using a fresh install of XAMPP.

Richard Skinner
  • 738
  • 3
  • 10
  • 26

1 Answers1

35

You're missing a <, which means you want to direct the content of the file into mysql.

mysql -u root -p [DB_NAME] < C:\Users\user_name\Downloads\file.sql
fancyPants
  • 50,732
  • 33
  • 89
  • 96
  • 1
    My bad. Sometimes the smallest things get over looked. – Richard Skinner Sep 24 '14 at 11:27
  • 1
    Wonder if you help on this dilemma. I have a SQL script - obviously - and i'm doing a string replace, looking for all occurrences of the live URL and replacing with the dev URL, however when this is done, it breaks the script. Now the script breaks in different places every time i try this. Also, the script works fine if i don't string replace. Confused. – Richard Skinner Sep 24 '14 at 11:30
  • 1
    Would have to see the script. But it's not good to mix questions (it's a Q&A site, not a forum). Please ask this in a different question. – fancyPants Sep 24 '14 at 11:38
  • Thought that might be the case so I've saved the question and will post in the next hour as the is blocking me from doing so. Thanks anyway. – Richard Skinner Sep 24 '14 at 11:43
  • Upvote .. just sometimes programmers also use `-h` in the command. Do you know what's that for? – Shafizadeh Jul 15 '17 at 04:07
  • 1
    For the hostname. – fancyPants Jul 15 '17 at 08:13