473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Shell and Mysql

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

Oct 8 '05 #1
1 1478
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
Oct 8 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lecichy | last post by:
Hello Is it possible to change shell user password via www form ? I mean using fsockopen, scrtipt would connect to server via SSH, provide current username and password and then execute shell...
1
by: iksrazal | last post by:
Hi all, I've been struggling to make this command work from Java: /usr/bin/mysql c4 --user=root --password=mypass -e "source /home/crissilva/c4.sql" Works fine as shown when run from the...
1
by: Brian Sadler | last post by:
Does anyone know where I can find information on how to setup my shell in unix/linux to allow me to restore a database from an sql dump... Example... I have a database on 83200.mysql.com ...
1
by: amitgupta007 | last post by:
Hi, I am migrating one of my application from Oracle to MySQL. We are using user defined variable which we are using in the sql scripts. In Oracle it is done using "DEFINE". The similar thing...
1
by: mm | last post by:
I have several korn shell scripts I use with a MySQL database on the same server (Solaris). I am moving to a Linux environment where the MySQL database is on another server. I would like to...
3
by: apostolosl | last post by:
Hi there. I need to update a remote database from a local one. I use mysqldump in my php page in order to create a file for each table, like this: $command="mysqldump table_products >...
2
by: David Dawson | last post by:
I have forgotten a lot about SQL and would like to be (gently) reminded how to do this: In a MySQL query on the database (one table with 15 variable length fields, I want to put each field into a...
2
ram09
by: ram09 | last post by:
i am trying to do database replication in mysql...and as i read the manual, aside from the statements i need to execute in the mysql command client... i read some statements that was executed in...
8
by: xtremebass | last post by:
Hi Bytes.. i have need to assign Mysql Database DataField value to shell script variable . is it possible ? i have tried like this .. got error.. #!bin/sh password=xxx mysql -u root...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.