Click here to get back home

Shell and Mysql

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Shell and Mysql lampakump 10-08-2005
Get Chitika Premium
Posted by lampakump on October 8, 2005, 12:25 pm
Please log in for more thread options
I am trying to run a mysql batch script through the shell. The one
problem though is that the error messages out of my script dont go to
the redirect i.e., if I run

mysql<test.sql>test.log

the error messages do no print into test.log, but to the command line.
I would like to capture the errors into this log file as well. Any
ideas?

Thanks,

Harsha



Posted by SomeDude on October 8, 2005, 9:58 pm
Please log in for more thread options
On Sat, 08 Oct 2005 12:25:43 -0700, lampakump wrote:

> I am trying to run a mysql batch script through the shell. The one
> problem though is that the error messages out of my script dont go to
> the redirect i.e., if I run
>
> mysql<test.sql>test.log
>
> the error messages do no print into test.log, but to the command line.
> I would like to capture the errors into this log file as well. Any
> ideas?
>
> Thanks,
>
> Harsha

In general you can capture all generated output by adding 2>&1 to your
command:

mysql< test.sql > test.log 2>&1

Should do the trick.

        SomeDude




Similar ThreadsPosted
Reading Variables available in shell program into MySQL September 26, 2005, 12:39 am
Linux Korn Shell 93 Connecting to a networked MySQL database. February 8, 2006, 7:33 pm
Shell redirect from java help needed July 5, 2005, 7:29 pm
Restoring a database from shell and sql dump September 22, 2005, 6:22 pm
Extracting Field data and putting each field into a shell variable? June 19, 2006, 3:28 pm
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' January 12, 2006, 9:26 pm
Problem with accent Import to MySQL/Linux from MySQL Windows September 4, 2005, 1:54 am
MySQL variables, modifying Microsoft SQL sequence insert for use in mysql October 7, 2005, 10:54 am
I want to make transfer data between MySQL Server to MySQL Local . February 9, 2006, 1:25 am
restoring a 4.0.17 mysql server without a mysql dump file July 20, 2005, 12:12 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap