如何清除在 Windows XP 上通过 MySQL 命令行客户端打开的 MySQL 屏幕
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2514914/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to clear the MySQL screen opened through the MySQL Command Line Client on Windows XP
提问by mithun1538
How do i clear the MySQL screen, which I opened through the MySQL Command Line Client?
如何清除通过 MySQL 命令行客户端打开的 MySQL 屏幕?
The operating system is Windows XP.
操作系统为 Windows XP。
采纳答案by Pekka
回答by Singamalai
Note: Please see @Pekka's answerfor the Windows version, which seems to be that there is none for windows. However, thisis a useful post to take a look at for windows. The remainder of this answer shows how you can do it in Unix / Linuxand exists for historical significance as it has clearly been useful to some users.
注意:请参阅@Pekka对 Windows 版本的回答,Windows 版本似乎没有。但是,这是一个有用的帖子,可以查看 Windows。此答案的其余部分显示了如何在Unix / Linux 中执行此操作,并且具有历史意义,因为它显然对某些用户有用。
To clear the editor screen in Unix/Linux you can type:
要清除 Unix/Linux 中的编辑器屏幕,您可以键入:
system clear
This makes use of mysql's system
commandto call the shell's clear
command.
这利用了 mysql 的system
命令来调用 shell 的clear
命令。
Note: the system
command works only in Unix.
注意:该system
命令仅适用于 Unix。
回答by Nanhe Kumar
\! clear
Since 'clear' is a Linux operating system command and Linux and Mac OS X are both forms of Unix, this command might very well work fine for you too.
由于“clear”是 Linux 操作系统命令,而 Linux 和 Mac OS X 都是 Unix 的形式,因此此命令也可能对您很有效。
Please note that the '! ' in front of the clear command is used to tell MySQL to pass the command back to the OS to handle.
请注意'! ' 前面的 clear 命令用于告诉 MySQL 将命令传递回 OS 进行处理。
回答by sufinawaz
You could use system clear
like @Singamalai mentioned or even use keyboard shortcut like CTRL+ L
您可以system clear
像提到的@Singamalai 一样使用,甚至可以使用像CTRL+这样的键盘快捷键L
回答by john400
I know this question is for Windows but since so many answers have been provided already I just thought to extend it for Linux users also so it will be beneficial for future users too.
我知道这个问题是针对 Windows 的,但由于已经提供了这么多答案,我只是想为 Linux 用户扩展它,这样对未来的用户也有好处。
So in Linux you can do
所以在Linux中你可以做
Ctrl + L
Ctrl + L
to clear the MySQL command window running through terminal.:)
清除通过终端运行的 MySQL 命令窗口。:)
回答by reko_t
You can clear the screen with:
您可以使用以下方法清除屏幕:
system cls
Or alternatively
或者替代地
\! cls
回答by kurt
Whenever I need to work on my stuff, I use Windows PowerShell to drop into the mysql shell. The only way I've found to clear the screen is to
每当我需要处理我的东西时,我都会使用 Windows PowerShell 进入 mysql shell。我发现清除屏幕的唯一方法是
- Exit mysql
- Type
cls
at the powershell prompt - Drop back into the mysql shell again
- 退出mysql
- 键入
cls
在PowerShell提示符 - 再次回到 mysql shell
It's a kind of workaround, but it works for me, I guess.
这是一种解决方法,但我想它对我有用。
回答by pamu
I done this workaround for Windows Right-click on the top frame of console -> Properties -> Layout -> and set Screen Buffer Size Height to large number.
我为 Windows 完成了这个解决方法右键单击控制台的顶部框架 -> 属性 -> 布局 -> 并将屏幕缓冲区大小高度设置为大数字。