MySQL command output too wide in command-line client [duplicate]

强颜欢笑 提交于 2019-12-04 12:57:07

Using mysql's ego command

From mysql's help command:

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

So by appending a \G to your select, you can get a very clean vertical output:

mysql> select * from routines where routine_name = "simpleproc" \G

Using a pager

You can tell MySQL to use the less pager with its -S option that chops wide lines and gives you an output that you can scroll with the arrow keys:

mysql> pager less -S

Thus, next time you run a command with a wide output, MySQL will let you browse the output with the less pager:

mysql> select * from routines where routine_name = "simpleproc";

If you're done with the pager and want to go back to the regular output on stdout, use this:

mysql> nopager

You can try also adjusting the font size of the terminal but displaying the output vertically should be clear if all doesn't. use the /G option to run the query i.e

mysql> select * from routines where routine_name = "simpleproc" /G
Danushka herath

If you are running on Ubuntu you can use the bash shell, it looks nice and not messed up like this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!