0

I had .sql file in D:/xxx/User.sql file, and mysql home in c drive. Now i want to import this .sql file in Pr Schema Till now what i tried is msql -u root -p<d:/xxx/User.sql file . I am trying to dump in this way by following one on link. can any 1 please let me know the exact procedure for executing sql file in mysql

0

3 Answers 3

1
msql -u root -p<d:/xxx/User.sql file

Well, this has several mistakes.

The command is mysql not msql.

There needs to be a whitespace between -p and <d:/xxx/User.sql file

What is the file at the end of this command? This shouldn't be there.

Note, there should only not be a whitespace after -p when you actually specify a password.

You haven't specified a database, in which your script should be running.

The correct way should be

mysql -u root -p yourDatabaseName < d:/xxx/User.sql

Flo Doe's answer is also fine.

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

Comments

1

Connect to you mysql instance and select the schema where you want to execute this file. The use the following command:

source d:/xxx/User.sql;

See also mysql docs - batch commands

Comments

0

you can import .sql file by phpmyadmin then to database in which you have to import then on Right side upper an column name import is there select exact position and import it

2 Comments

cant i import .sql file directly from mysql database,
$ mysql -u username -p -h localhost DATA-BASE-NAME < data.sql this syntax can do this

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.