Link to home
Start Free TrialLog in
Avatar of Kiran Paul VJ
Kiran Paul VJFlag for India

asked on

clear screen in mysql command prompt

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
ASKER CERTIFIED SOLUTION
Avatar of pradapkumar
pradapkumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kiran Paul VJ

ASKER

hi pradap,

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

kiranvj

increasing points
hi pradapkumar,

which is the link

kiranvj
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.
If you are in unix, just run:
mysql> system clear

From DOS (or windows), just run
mysql> system cls
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
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.

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
Did you try my two SELECT commands?  Did either work?
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)
 
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

no probs, i think there is no feature like that.
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...
>>please wait until 20:00 CET so i can check that myself at home, im pretty sure theres something to do that...

sure
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

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