Already asked a question about editing multi-line queries in mysql from under the console. Solution found - vi. But unfortunately, in view of the small experience, I could not complete the idea. The question is: how to get the result back from the vi editor back to the mysql console? Those. I write the request, at the end I specify e, I edit the request ... And then what?
export EDITOR=/usr/bin/mcedit
or write it in the login script, something forever :-) Unfortunately, I don’t know the specifics, but I usually work with a remote machine via ssh -Trunk the tunnels there, for example, then it is convenient to use the GUI pribludy local machine to work with SQL servers and more. - chernomyrdin