mysql 控制臺(tái)程序的提示符 prompt 字符串設(shè)置
更新時(shí)間:2011年08月07日 11:37:47 作者:
mysql 控制臺(tái)程序的提示符 prompt 字符串設(shè)置,學(xué)習(xí)mysql的朋友可以參考下。
The prompt command reconfigures the default mysql> prompt. The string for defining the prompt can contain the following special sequences.
mysql 控制臺(tái)程序的默認(rèn)提示符為 "mysql>". 該提示符可用根據(jù)需要進(jìn)行修改設(shè)置:
有以下幾種設(shè)置方式:
設(shè)置shell 的環(huán)境變量 : MYSQL_PS1
shell> export MYSQL_PS1="(\u@\h) [\d]> "
使用程序啟動(dòng)命令選項(xiàng) : --prompt
shell> mysql --prompt="(\u@\h) [\d]> "
(user@host) [database]>
設(shè)置選項(xiàng)文件中的 [mysql] 節(jié),添加 prompt 選項(xiàng)
[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>
mysql 控制臺(tái)程序的默認(rèn)提示符為 "mysql>". 該提示符可用根據(jù)需要進(jìn)行修改設(shè)置:
有以下幾種設(shè)置方式:
設(shè)置shell 的環(huán)境變量 : MYSQL_PS1
shell> export MYSQL_PS1="(\u@\h) [\d]> "
使用程序啟動(dòng)命令選項(xiàng) : --prompt
shell> mysql --prompt="(\u@\h) [\d]> "
(user@host) [database]>
設(shè)置選項(xiàng)文件中的 [mysql] 節(jié),添加 prompt 選項(xiàng)
[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 中一些特殊的轉(zhuǎn)義字符串
Option | Description |
---|---|
\c |
A counter that increments for each statement you issue |
\D |
The full current date |
\d |
The default database |
\h |
The server host |
\l |
The 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 |
\p |
The current TCP/IP port or socket file |
\R |
The current time, in 24-hour military time (0–23) |
\r |
The current time, standard 12-hour time (1–12) |
\S |
Semicolon |
\s |
Seconds of the current time |
\t |
A tab character |
\U |
Your full |
\u |
Your user name |
\v |
The server version |
\w |
The current day of the week in three-letter format (Mon, Tue, …) |
\Y |
The current year, four digits |
\y |
The current year, two digits |
\_ |
A space |
\ |
A space (a space follows the backslash) |
\' |
Single quote |
\" |
Double quote |
\\ |
A literal “\ ” backslash character |
\ |
|
相關(guān)文章
阿里云配置MySQL-server?8.0遠(yuǎn)程登錄的實(shí)現(xiàn)
我們經(jīng)常會(huì)碰到需要遠(yuǎn)程訪問數(shù)據(jù)庫(kù)的場(chǎng)景,本文主要介紹了阿里云配置MySQL-server?8.0遠(yuǎn)程登錄的實(shí)現(xiàn),具有一定的參考價(jià)值,感興趣的可以了解一下2023-08-08MySQL5.6 GTID模式下同步復(fù)制報(bào)錯(cuò)不能跳過的解決方法
搭建虛擬機(jī)centos6.0, mysql5.6.10主從復(fù)制,死活不同步,搞了一整天找到這篇文章終于OK了,特分享一下,需要的朋友可以參考下2020-04-04Mysql性能優(yōu)化案例研究-覆蓋索引和SQL_NO_CACHE
這篇文章主要介紹了Mysql性能優(yōu)化案例研究-覆蓋索引和SQL_NO_CACHE,需要的朋友可以參考下2016-03-03