that is a shell question using bash/ksh stuff you can use this:
mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt 2>&1
Ananda Kumar wrote:
> The problem with below statement is that, if i there is any error in sql
> statements it does not get written to 1.txt. So, even
Thank u, this works.
On 7/30/08, Jim Lyons <[EMAIL PROTECTED]> wrote:
>
> Try:
>
> mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt 2>
> 1.txt
>
> or
>
> mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt 2>
> 1.errs
>
> This will redirect STDERR.
The problem with below statement is that, if i there is any error in sql
statements it does not get written to 1.txt. So, even if there is any
error, how can i get it written to 1.txt.
mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt
On 7/29/08, Mary Bahrami <[EMAIL
I use
mysql -uroot -pxxx -Dtest -s -e 'select * from amc_25;' > 1.txt
but it would be nice to see other solutions...
-Original Message-
From: Ananda Kumar [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 29, 2008 6:37 AM
To: mysql
Subject: spool log to a file
Hi All,
I am executing
Hi Baron,
I will read about sql_mode. Also you scripting method sounds great.
I will check on that.
regards
anandkl
On 5/21/07, Baron Schwartz <[EMAIL PROTECTED]> wrote:
Hi,
You could change your server's SQL mode to be as restrictive as possible
(STRICT_TRANS_TABLES, etc) so the scripts ca
Hi,
You could change your server's SQL mode to be as restrictive as possible
(STRICT_TRANS_TABLES, etc) so the scripts cause errors, instead of warnings. Read the
MySQL manual section on SQL mode and decide which things you want to throw errors. Not
all things can be changed to errors; you w
Hi Baron,
I cannot do this, becuase the file would be given by engineers and to be
applied on mysql and i need to inform them about any error after i apply
them in mysql db.
regards
anandkl
On 5/21/07, Baron Schwartz <[EMAIL PROTECTED]> wrote:
Hi,
I see now -- you want to see which commands
Hi,
I see now -- you want to see which commands were executed from the file you sourced.
As far as I know you cannot do this. You could add some debugging statements in the
file, like
SELECT 'about to drop the table';
Then in the output you will see this, and it may give you a hint as to wh
Hi Baron,
This will give only the results of the command. It does not include sql
statement.
I need the sql statement to know which sql errored out.
Database changed
+--+
| count(*) |
+--+
|5 |
+--+
1 row in set (0.00 sec)
On 5/21/07, Baron Schwartz <[EMAIL PROT
Hi,
Ananda Kumar wrote:
Hi All,
I am executing a script from mysql prompt as below
mysql > source ddl.txt
I want to spool the out put of the above command to a file along with the
sql statments. Can you please let me know what parameter should i set for
the this.
Use the 'tee' command in th
Hi Michale, all
[EMAIL PROTECTED] wrote:
most likely you just need to redirect STDERR to tee as well so it's not
a mysql problem:
mysql -u -p -f << eof 2>&1 | tee ttt.txt
...
assuming it's Bourne or ksh, don't remember what's csh for 2>&1
It is an appended '&': prog >& file
most likely you just need to redirect STDERR to tee as well so it's not
a mysql problem:
mysql -u -p -f << eof 2>&1 | tee ttt.txt
...
assuming it's Bourne or ksh, don't remember what's csh for 2>&1
Regards,
Michael
-Original Message-
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
S
Silmara,
Wednesday, November 13, 2002, 6:45:51 PM, you wrote:
S> The MySQL have SPOOL where can I stores query results in a file?
S> How can I do this?
Sorry, your question is not clear enough for me.
Take a look at SELECT .. INTO OUTFILE command
or may be --tee option of mysql command-line cli
13 matches
Mail list logo