Let me get it straight here -- you're at the mysql database prompt, and it's doing the things you describe?
Just to get on the same page I just loaded mysql-server on my wife's ubuntu computer.
When she complains about disk space, I'm going to blame you, sorry
Anyway, try this instead of the control/z you mention (that's an old vi short-hand that truly used to be synonymous with :wq! [write and quit], so if this was working before, it kinda sets off vi-purist alarm bells in my head
Instead of control/z, try:
[esc]:![return]
I know it's a couple of extra sequences, but it's vi for "shell out to the OS" which in this case is not an OS at all, but mysql.
I hope this helps -- maybe someone else on the list knows of a way to make the vim/mysql happiness work better, but the above should work theoretically.
Cheers!
-=FeriCyde=-