1

Doing

mysql -uroot -p -e source F:\code\mysql\mysql-data\myHfs\test.sql  

gives : ERROR 1049 (42000): Unknown database 'f:\code\mysql\mysql-data\myhfs\test.sql'

But if i go inside the mysql command promt with just the mysql -uroot -p and then type in source F:\code\mysql\mysql-data\myHfs\test.sql , i get the proper output.

the content of the above file being :

use gregs_list;
show tables;
select * from clown_info;

Edit : doing mysql -uroot -p < "F:\code\mysql\mysql-data\myHfs\test.sql" -t seems to solve the problem.

1 Answer 1

1

http://dev.mysql.com/doc/refman/5.0/en/mysql-batch-commands.html

mysql -uroot -p < "F:\code\mysql\mysql-data\myHfs\test.sql"

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

5 Comments

i get mysql: option '-e' requires an argument
Sorry, try again without that argument.
this works : mysql -uroot -p < "F:\code\mysql\mysql-data\myHfs\test.sql" -t
The -t option seems strictly only for display, you could do without it if you didn't need the output.
true. But I'm trying this to build my sql query from inside sublimetext 2 , and this argument will be passed to the command line.

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.