

Readable MySQL command line output (Looks like YAML) - kevTheDev
http://rubyisawesome.com/2007/7/10/mysql-secrets-g-instead-of

======
bprater
I discovered the goddamn \G trick about six months ago. I couldn't believe I
hadn't picked it up anywhere else. It's the most useful thing you can learn
when dealing with the MySQL shell! (Especially when your eyes buzz out trying
to line up a huge table!)

------
inrev
It seems you guys never seen the "mysql Tips" section in the MySQL manual:

[http://dev.mysql.com/doc/refman/5.0/en/mysql-
tips.html#verti...](http://dev.mysql.com/doc/refman/5.0/en/mysql-
tips.html#vertical-query-results)

~~~
aston
Or this:

    
    
      mysql> help
    

which has gems like

    
    
      clear     (\c) Clear command.
      edit      (\e) Edit command with $EDITOR.
      ego       (\G) Send command to mysql server, display result vertically.
      quit      (\q) Quit mysql.
      source    (\.) Execute an SQL script file. Takes a file name as an argument.
      system    (\!) Execute a system shell command.
      tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
    

\c alone could save you a ton of headache. \e's pretty classy, too; just make
sure you follow it with a semicolon to execute the command.

------
vasudeva
This is a really useful trick.

Does anyone know of an Oracle analog?

~~~
jrockway
Just write a program to connect to oracle, run queries, and print the results
in your desired format. It should be about 5 lines of code.

See also DBI::Shell on CPAN.

------
marrone
goddamn, this is great. Why have I never heard of this before

