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
3 Answers
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.
Comments
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
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