MySQL Import Database Schema
41,977
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
Author by
Richard Skinner
Updated on September 25, 2020Comments
-
Richard Skinner over 3 years
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 over 9 yearsMy bad. Sometimes the smallest things get over looked.
-
Richard Skinner over 9 yearsWonder 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.
-
fancyPants over 9 yearsWould 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.
-
Richard Skinner over 9 yearsThought 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.
-
Shafizadeh almost 7 yearsUpvote .. just sometimes programmers also use
-h
in the command. Do you know what's that for? -
fancyPants almost 7 yearsFor the hostname.