Traditionally:
1 2 3 4 5 6 7 8 |
mysql> select * from INNODB_SYS_COLUMNS limit 3; +----------+----------+-----+-------+--------+-----+ | TABLE_ID | NAME | POS | MTYPE | PRTYPE | LEN | +----------+----------+-----+-------+--------+-----+ | 11 | ID | 0 | 1 | 524292 | 0 | | 11 | FOR_NAME | 1 | 1 | 524292 | 0 | | 11 | REF_NAME | 2 | 1 | 524292 | 0 | +----------+----------+-----+-------+--------+-----+ |
To save output:
1 2 3 4 |
mysql> pager cat > /tmp/output PAGER set to 'cat > /tmp/output' mysql> select * from INNODB_SYS_COLUMNS limit 3; 3 rows in set (0.00 sec) |
1 2 3 4 5 6 7 8 |
# cat /tmp/output +----------+----------+-----+-------+--------+-----+ | TABLE_ID | NAME | POS | MTYPE | PRTYPE | LEN | +----------+----------+-----+-------+--------+-----+ | 11 | ID | 0 | 1 | 524292 | 0 | | 11 | FOR_NAME | 1 | 1 | 524292 | 0 | | 11 | REF_NAME | 2 | 1 | 524292 | 0 | +----------+----------+-----+-------+--------+-----+ |
To format output to space delimited:
1 2 3 4 5 6 7 |
mysql> pager grep -Ev '^\+-' | column -t -s '|' PAGER set to 'grep -Ev '^\+-' | column -t -s '|'' mysql> select * from INNODB_SYS_COLUMNS limit 3; TABLE_ID NAME POS MTYPE PRTYPE LEN 11 ID 0 1 524292 0 11 FOR_NAME 1 1 524292 0 11 REF_NAME 2 1 524292 0 3 rows in set (0.01 sec) |
I found CentOS 7 and Ubuntu 16.04 uses different column commands,
in CentOS 7, column is from util-linux, in Ubuntu 16.04 and OSX, BSD like.
I tried to format output as TSV, but failed.
MySQL Client Format Output to Space-Delimited by @sskaje: https://sskaje.me/2017/05/mysql-client-format-output-space-delimited/
Incoming search terms:
- for example if the two guards that were paired started with 3 and 5 bananas after the first round of thumb wrestling they will have 6 and 2 (the one with 3 bananas wins and gets 3 bananas from the loser) after the second round they will have 4 and 4 (the
- formatting OUTPUT mysql WITHOUT SPACE
- lonelyqm5
Link to this post!