Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Long form of the MySQL client "ego" command, how to use it?

Tags:

mysql

According to the reference manual, the MySQL client has the command:

ego (\G) Send command to mysql server, display result vertically.

...

Each command has both a long and short form. The long form is not case sensitive; the short form is. The long form can be followed by an optional semicolon terminator, but the short form should not. [source]

I'm just playing around in the command line client and the \G form works:

select * from company \G

How would I use the long "ego" form if I wanted to? Does it work in the command line client? I just can't figure it out and Google isn't turning up anything.

Thanks!

like image 737
Vimes Avatar asked Nov 17 '10 08:11

Vimes


2 Answers

Start MySQL client with --named-commands.

(none)>select 'hi'
    -> ego
*************************** 1. row ***************************
hi: hi
1 row in set (0.00 sec)
like image 84
FilipeSilva Avatar answered Sep 19 '22 20:09

FilipeSilva


ego is available for command line only. By default queries are delimited using semicolons (;). This applies to any API that connects to mysql.

like image 24
ajreal Avatar answered Sep 18 '22 20:09

ajreal