13

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.

1 Answer 1

34

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
6
  • 1
    My bad. Sometimes the smallest things get over looked. Sep 24, 2014 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. Sep 24, 2014 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, 2014 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. Sep 24, 2014 at 11:43
  • 1
    For the hostname.
    – fancyPants
    Jul 15, 2017 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.