Command Line of mysql is not displaying results properly. I mean some columns of table are in 1st line some in 2nd line. Output is also broken into two rows. How do I adjust these settings so that it properly display results.
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
- mySQL alter table on update, current timestamp
In Microsoft Windows mysql Command Prompt, Right-click on the prompt boarder and select Properties, now select the Layout tab and change the Window Size width or screen buffer width to a more suitable view. That should fix the problem.
To set the scrolling automatically add this to your my.cnf file in the [client] section like this:
Another option, which I was looking for and finally found, is the MySQL string function
LEFT()
.For example ...
... becomes ...
I do like the
\G
andpager less -Sin
options, and use them. Often, however, I need the results in a normal fashion. With the pager option I loose the ability to reference, visually, the previous results, as the output is displayed by the selected program, externally to MySQL, and is no longer displayed when that program is closed. With the\G
option I can easily compare the data of each record as a whole, but comparing records, such as viewing the column looking for patterns, or discrepancies, is not so easy.What I used to do was remove some of the columns until the results fit in the window, and rerun the queries with other columns removed, and developed a "view" of the table in my mind. (Not a good place to keep tables.) I seldom need to view the entire column, however, when using MySQL in the terminal, and selectively reducing an excessively long column from a query can be done by editing the last command to insert
LEFT()
around the offending column, and I'm back to doing what I needed to do, with little distraction or lost time.You can use the
\G
command (instead of the;
) at the end of your SQL queries...Example:
It will display your table in row form instead of column form.
mostly this happens when the row it fetches is too long. try playing with your terminal to have scroll bar and you could even reduce fonts.
The mysql option is