如何清除在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:36:56  来源:igfitidea点击:

How to clear the MySQL screen opened through the MySQL Command Line Client on Windows XP

mysqlwindowscommand-linecmd

提问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

There is a number of solutions in Linux like this one, but the consensus seems to be there is none for Windows. See e.g. hereor here(scroll to the bottom)

还有一些在Linux解决方案像这一个,但共识似乎是有没有为Windows。参见例如这里这里(滚动到底部)

回答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 systemcommandto call the shell's clearcommand.

这利用了 mysql 的system命令来调用 shell 的clear命令

Note: the systemcommand 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 clearlike @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。我发现清除屏幕的唯一方法是

  1. Exit mysql
  2. Type clsat the powershell prompt
  3. Drop back into the mysql shell again
  1. 退出mysql
  2. 键入cls在PowerShell提示符
  3. 再次回到 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 完成了这个解决方法右键单击控制台的顶部框架 -> 属性 -> 布局 -> 并将屏幕缓冲区大小高度设置为大数字。