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??


Recommended Answers

All 2 Replies

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


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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.