0

hello,
i wrote some commands in notepad and saved it as .sql and i m running these commad at my sql by command-
mysql>source C:\Program Files\MySQL\MySQL Server 5.0\bin\script.sql;
then its run.. but hat to do if i write it without giving whole path.

i ren this command--
mysql> \. filename

but its not working...why?? i am not gettiing .is there is any prob with path setting??

thanks

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by RvSon
0

Have you thought about simply putting it in a batch file. You can call a sql script straight from the command line or put it in a batch file like this:

mysql -u root -ppassword mydatabase < myscript.sql

Or you can use the first line of the script to designate the database:

mysql -u root -ppassword < myscript.sql

Script

USE mydatabase;
select * 
from mytable 
where id = '100';
0

yar u wont get in that way. its for sure, bcz u trying to fetch batch file. which will be not recognize by mysql server. need to put all the stuff like login nd password, and the whole handsome path to where ur Query has been store

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.