Display mysql results nicely

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Display mysql results nicely
# 1  
Old 04-01-2012
Display mysql results nicely

Hi, perhaps this is a dumb question.

I'm running queries on mysql and I'm getting tabbed results like these:


Code:
mysql> SELECT * from metrics_status WHERE date = '2012-03-30';
<TABLE BORDER=1><TR><TH>name</TH><TH>status</TH><TH>lastupdate</TH><TH>date</TH></TR><TR><TD>lobby</TD><TD>CALCULATION_FINISHED</TD><TD>2012-03-30 11:06:46</TD><TD>2012-03-30</TD></TR><TR><TD>plasma</TD><TD>CALCULATION_FINISHED</TD><TD>2012-03-30 12:32:32</TD><TD>2012-03-30</TD></TR><TR><TD>blaze</TD><TD>CALCULATION_FINISHED</TD><TD>2012-03-30 10:17:35</TD><TD>2012-03-30</TD></TR><TR><TD>blazev3</TD><TD>CALCULATION_FINISHED</TD><TD>2012-04-01 16:20:08</TD><TD>2012-03-30</TD></TR></TABLE>4 rows in set (0.08 sec)

Is there a way to display that nicely? Withouth all the TDs and TRs.

---------- Post updated at 07:59 PM ---------- Previous update was at 07:58 PM ----------

Should you need more info

Code:
$ uname -a
Linux - 2.6.18-92.el5xen #1 SMP Tue Apr 29 13:31:30 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

$ mysql -V
mysql  Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (x86_64) using readline 5.0

# 2  
Old 04-02-2012
Hi there.
Showing results formatted with html table tags isn't the default behavior of MySQL.
Perhaps your MySQL configuration file (my.cnf) was modified.
Try calling the MySQL client command with the --table (or -t) option, like this:
Code:
mysql -uuser -puserpassword --table

Obviously, remember to change the user and userpassword mentioned above for something that is suitable for your needs.
If that works, take a look at your my.cnf file (Usually, this file is located at /etc/my.cnf) and look for something mentioning the html option.
That' it. Hope it helps you! Good luck mate!
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to display some special results with AWK

I have a file like this: AAEQGAGNQPQH,,,,160,32,,,, AAGQDYNSPLH,,712,39,,,,,, AAGREGGNTEAF,26,,,,,,,,4 AAGSPQH,,,,8,5,,,, AAKKLGQFYNEQF,4,,6,,,7,,,2 AANSGGRYNEQF,,2747,3120,,,,,, AAQGGVGGELF,,,,5,,12,36,, AAQGLAGYYEQY,,25,13,,,,,, AAQRGNEQF,510,2,,,6,,6,,76 AAQTGENSPLH,,16,16,,,,,, The... (9 Replies)
Discussion started by: xshang
9 Replies

2. Shell Programming and Scripting

Display find results, and pipe to xargs

I have an overnight script which runs across a large directory to repair permissions and ownership. I also have this command output the list of files affected so that cron can email these as a log file. Previously I had the command in the form: find /path/to/files -not -user myname -print -exec... (4 Replies)
Discussion started by: mij
4 Replies

3. Shell Programming and Scripting

Shell script compare all parameters in two files and display results

Hi , I am not familiar with shell programming. I have a requirement like i have two files .I need to compare the two files by comparing each parameter and i should produce 2 outputs. 1)i have around 35 parameters say i have one parameter name called db_name=dcap in one file and... (7 Replies)
Discussion started by: muraliinfy04
7 Replies

4. Shell Programming and Scripting

sed scripts are not playing nicely!

I am having a lot of trouble, wasting a lot of time trying to get sed script files to run without problem. I have a list of scripts I want to run on a text file to turn it into a viewable html file for my mobile phone. Each of the single scripts when run in order/sequence one after another on the... (4 Replies)
Discussion started by: naphelge
4 Replies

5. Shell Programming and Scripting

Display echo results in three column

Dear Friends, I have my command output which displays on one row and values are now scrollable (vertical) 3 pages. How do i display those output in three column so that i no need to scroll? Example: dcadd$cat components 1.Caluculator 2.Diary ... ... 50.Mobile 51.Battery .. ...... (12 Replies)
Discussion started by: baluchen
12 Replies

6. Shell Programming and Scripting

tab string variables nicely

I'm using korn shell for my shell script I'm reading a file and get the data I want out and append it to a variable directly, it shows like this AutoMicroReport_53767.txt BANI BHUM (570N) 20080520 17:54 WAN HAI 306 078 ITH 1 1 HKHKG 20 GP M S06 7 6 1 0 TCYONG AutoMicroReport_53767.txt... (2 Replies)
Discussion started by: finalight
2 Replies

7. UNIX for Dummies Questions & Answers

How to display first 7 char of grep results?

My file contains the following: uat2000.aspclient.active=true uat2001.aspclient.active=true uat2002.aspclient.active=true uat2003.aspclient.active=true uat2004.aspclient.active=false uat2005.aspclient.active=false uat2006.aspclient.active=false uat2007.aspclient.active=false... (8 Replies)
Discussion started by: kthatch
8 Replies

8. Solaris

Top and Prstat display different results for memory

I have a question about the accuracy of prstat. I did a 'prstat -t' and it shows 99% of my memory is occupied by oracle. NPROC USERNAME SIZE RSS MEMORY TIME CPU 194 oracle 343G 340G 99% 86:17.24 56% However, 'top' shows I still have 7762meg of memory free. Memory: 16G real, 7762M... (4 Replies)
Discussion started by: zen03
4 Replies
Login or Register to Ask a Question