Title: Message
Hi Wilson,
 
This is just a guess but there might be some escaping going on with your redirection to an output file ('>').  If you try using the output attribute in the <exec /> task I am guessing that this should go away.  An example (not tested) would look like this:
     <exec program="c:/mysql/bin/mysql" commandline="-e source c:/mysql/bin/Manufatura_DBCreate.sql" output="c:/mysql.out" />
 
If this does not work could you post your build file, or at the least the target containing the <exec /> task that you are using?
 
Cheers,
 
Clayton
-----Original Message-----
From: Wilson Ricardo Passos Oliveira [mailto:[EMAIL PROTECTED]
Sent: April 1, 2004 6:54 AM
To: [EMAIL PROTECTED]
Subject: [Nant-users] MySQL database script inside NAnt

Hi fellows,


I've been trying to execute a MySQL script to create a database using NAnt, as one of some tasks the NAnt script has to execute.

My database create script is in a file named Manufatura_DBCreate.sql and, when I execute this command directly from a DOS prompt, it correctly works, creating the database:
c:/mysql/bin/mysql -e "source c:/mysql/bin/Manufatura_DBCreate.sql" > c:/mysql.out

But, from the NAnt's script (after installing and starting MySQL's service inside the script), I got this message:

mysql:

     [exec] c:/mysql/bin/mysqld-max-nt --install
            Service successfully installed.
     [exec] net start MySQL
            MySQL was successfully started.

     [exec] c:/mysql/bin/mysql -e "source c:/mysql/bin/Manufatura_DBCreate.sql" > c:/mysql.out
            c:/mysql/bin/mysql  Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
            Copyright (C) 2002 MySQL AB
            This software comes with ABSOLUTELY NO WARRANTY. This is free software,
            and you are welcome to modify and redistribute it under the GPL license
            Usage: c:/mysql/bin/mysql [OPTIONS] [database]
              -?, --help          Display this help and exit.
              --auto-rehash       Enable automatic rehashing. One doesn't need t....

Do you have any ideas what's going on? It simply prompts for MySQL's help and leave away the database's script execution.

Thank in advance for any help,
Wilson.
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to