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:

and...@myserver:~/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="(\...@\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:li...@voidship.net] 
Sent: 31 March 2009 15:57
To: mysql@lists.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.braithwa...@lovefilm.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to