OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
RE: Annoying .mysql_history problem

From: Andrew Braithwaite (andrew.braithwaitelovefilm.com)
Date: Fri Apr 03 2009 - 09:11:58 CDT


I know it's not quite the same but you can use a 'tee' to record what
you do.

I use a small script to invoke the mysql client that looks like this:

andrewmyserver:~/bin> cat ms
# takes input of server and logical DB, eg: 'ms db1 test'
echo "" >> /home/andrew/mysqlhistory/$1.history
echo
"=======================================================================
=====" >> /home/andrew/mysqlhistory/$1.history
echo "INITIALISING NEW SESSION>> /home/andrew/mysqlhistory/$1.history
date >> /home/andrew/mysqlhistory/$1.history
echo
"=======================================================================
=====" >> /home/andrew/mysqlhistory/$1.history
mysql --tee=/home/andrew/mysqlhistory/$1.history --prompt="(\u\h) [\d]>
" -u someuser -p -h$1 $2

This records both what you type and the results.

Hope this helps,

Andrew

-----Original Message-----
From: kabel [mailto:listsvoidship.net]
Sent: 31 March 2009 15:57
To: mysqllists.mysql.com
Subject: Annoying .mysql_history problem

Using MySQL 5.0.67 on OpenSolaris 2008.11, whenever I hit Ctrl-C to
terminate a long-running test query, it hangs while it kills the thread.

  No problem here. If I accidentally (or impatiently) hit Ctrl-C again,

it terminates the MySQL CLI. Again, no problem here. What's getting me

is that on Ubuntu, everything up to that point was still written to
.mysql_history, while on OSol it only goes back as far as my last clean
exit.

Is there any way to get the Ubuntu behavior? I know the easy answer is
"Don't use Ctrl-C, you hack" but I'd kind of like the .mysql_history to
be written as I go.

Thanks for any pointers,

kabel

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=andrew.braithwaitelovefilm.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql