[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

clear screen in mysql command prompt

Posted on 2006-03-11
19
Medium Priority
?
19,765 Views
Last Modified: 2008-03-10
hi experts,

is there anyway to clear the screen in mysql command line prompt. Like CLS in windows command prompt
I am using version 5.

thanx in advance

kiranvj
0
Comment
Question by:Kiran Paul VJ
  • 9
  • 4
  • 4
  • +1
19 Comments
 
LVL 9

Accepted Solution

by:
pradapkumar earned 300 total points
ID: 16165530
No that facility not yet available in the command line client of  MySQL.
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16165931
hi pradap,

thank for your reply, do u know any reference in the Mysql site about the above problem.

kiranvj
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16165935

increasing points
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16168477
hi pradapkumar,

which is the link

kiranvj
0
 
LVL 9

Expert Comment

by:pradapkumar
ID: 16174301
the above link documents all facilities available with client utility  programs.
why? whether that link works or not? in my system it works correctly.
In that link Chapter 8.5 explains the command line client's usage. Click on that link and read it.
0
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 16174496
If you are in unix, just run:
mysql> system clear

From DOS (or windows), just run
mysql> system cls
0
 
LVL 9

Expert Comment

by:pradapkumar
ID: 16174604
Hi Nova i run ur suggestion
but it gives following error.

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'syste
m cls' at line 1
0
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 16174757
Just checked http://dev.mysql.com/doc/refman/5.0/en/mysql-commands.html and it says that the system command runs only in unix.  That is silly.

You might be able to make mysql print a clear-screen escape sequence with
SELECT 0x1B080C\G
This ought to make mysql output a ESC BS ^L sequence which used to make the screen clear in old versions of dos.  I don't know if it works nowadays.  See http://www.modsoft.com/piclan/man/pl-12.htm

You can get the ANSI escape sequence to clear screen with this:
SELECT CONCAT(0x1B, '[2J')\G
See http://en.wikipedia.org/wiki/ANSI_escape_code

The \G prevents mysql from writing all that ascii grid around the result.
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16174942

hi pradapkumar,
i checked ur link,like you said there is no command to clear the screen.

hi NovaDenizen ,
i checked the links in ur last post, but none could slove my problem.

so i assume that there is no command in MySQL 5 to clear the contents of the screen and lets hope it will be incorporated in future versions.

thank u all for ur help.
and if there are no new inputs to this thread for next two or three days, i will be accepting the answers.

kiranvj
0
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 16174988
Did you try my two SELECT commands?  Did either work?
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16175120
hi NovaDenizen,

i tried both none worked,

mysql>select 0x1B080C\G
***********************1. row************************
0x1B080C:some ascii characters
1 row in set(0.00 sec)


mysql>SELECT CONCAT(0x1B, '[2J')\G
+-----------------------------------+
| concat(0x1B.'[2J')                  |
+-----------------------------------+
|  <2J                                     |
+-----------------------------------+
1 row in set (0.00 sec)
 
0
 
LVL 22

Assisted Solution

by:NovaDenizen
NovaDenizen earned 300 total points
ID: 16175169
Sorry, I don't know what to do from here.
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16175219

no probs, i think there is no feature like that.
0
 
LVL 12

Expert Comment

by:AmigoJack
ID: 16182824
search your documentation for a command that gets you to the system, like NovaDenizen suggested the "system" command. maybe on windows its named "host" orso... search for something like that and when you found it, you can then use any console command, like "cls". please wait until 20:00 CET so i can check that myself at home, im pretty sure theres something to do that...
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16182934
>>please wait until 20:00 CET so i can check that myself at home, im pretty sure theres something to do that...

sure
0
 
LVL 12

Assisted Solution

by:AmigoJack
AmigoJack earned 300 total points
ID: 16186626
ok i have to admit that it doesnt work on windows :( NovaDenizen and the documentation of mysql are both right; if you type in "help" the command "system" wont get listed at all on windows. sorry
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16187040
hi,

So three experts have said that its not possible, so what am i waiting for......

I am increasing the points and splitting 75(currently assigned) + 75 + 75

kiranvj
0
 
LVL 16

Author Comment

by:Kiran Paul VJ
ID: 16187107

oops, forgot to say thank u...

thank you friends, all your comment were really informative. i will be asking more ques abt mysql.... so cu soon.

bye
kiranvj
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question