Home  >  Article  >  Database  >  如何更改mysql命令下提示信息_MySQL

如何更改mysql命令下提示信息_MySQL

WBOY
WBOYOriginal
2016-06-01 13:56:34944browse

我们经常会遇到这样的问题你还在为你的MySQL命令模式下,前面的提示信息还是:

MySQL>,那么我们如何更改mysql命令下提示信息呢?

这样对当前选中哪个数据库,当前是用什么用户登录,登录是登录到哪台服务器上,都不知道。其实只要在登录时,多加一个参数,就可以搞定的。

正常登录是:

MySQL -h localhost -u root -p

只要在这信息后面加上:--prompt="前置信息" 就可以了。具体命令如下:

MySQL -h localhost -u root -p --prompt="/u@/h: /d :/m/s>"

登录后,显示的前置信息就会是:

root@localhost: 05:03:00>

其中就是你选择的数据库,当前是未选择数据库,所以是none.如果你选择了一个数据库:
use lyb;

就会显示如下:

root@localhost: lyb 05:03:00>

呵呵,这样是不是方便多了哈

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn