加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

MYSQL数据库mysql 控制台程序的提示符 prompt 字符串设置

发布时间:2020-12-12 00:59:47 所属栏目:MySql教程 来源:网络整理
导读:《MYSQL数据库mysql 控制台程序的提示符 prompt 字符串设置》要点: 本文介绍了MYSQL数据库mysql 控制台程序的提示符 prompt 字符串设置,希望对您有用。如果有疑问,可以联系我们。 The prompt command reconfigures the default mysql prompt. The string
c A counter that increments for each statement you issue D The full current date dThe default database hThe server host lThe current delimiter (new in 5.1.12) m Minutes of the current time n A newline character O The current month in three-letter format (Jan,Feb,…) o The current month in numeric format P am/pm pThe current TCP/IP port or socket file R The current time,in 24-hour military time (0C23) r S Semicolon s Seconds of the current time t A tab character U

Your full?user_name@host_name?account nameMYSQL必读

uYour user name v The server version w The current day of the week in three-letter format (Mon,Tue,monospace; BACKGROUND-COLOR: white; BORDER-RIGHT-WIDTH: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; background-origin: initial; background-clip: initial">Y The current year,four digits y _ A space ? A space (a space follows the backslash) ' Single quote " Double quote A literal “” backslash character xx,for any “x” not listed aboveMYSQL必读

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

《MYSQL数据库mysql 控制台程序的提示符 prompt 字符串设置》要点:
本文介绍了MYSQL数据库mysql 控制台程序的提示符 prompt 字符串设置,希望对您有用。如果有疑问,可以联系我们。

The prompt command reconfigures the default mysql> prompt. The string for defining the prompt can contain the following special sequences.

mysql 控制台程序的默认提示符为 "mysql>". 该提示符可用根据需要进行修改设置:

有以下几种设置方式:

设置shell 的环境变量 : MYSQL_PS1

shell> export MYSQL_PS1="(u@h) [d]> "

使用程序启动命令选项 : --prompt

shell> mysql --prompt="(u@h) [d]> "
(user@host) [database]>

设置选项文件中的 [mysql] 节,添加 prompt 选项

[mysql]
prompt=(u@h) [d]>_
在 mysql 程序中使用 prompt (R) 命令

mysql> prompt (u@h) [d]>_
PROMPT set to '(u@h) [d]>_'
(user@host) [database]>
(user@host) [database]> prompt
Returning to default PROMPT of mysql>
mysql>

prompt 中一些特殊的转义字符串MYSQL必读

Option Description
    推荐文章
      热点阅读