mysql 控制台程序的提示符 prompt 字符串设置
发布时间:2024-01-26 01:42:11
标签:mysql,控制台程序
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 中一些特殊的转义字符串
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 |
\ |
|


猜你喜欢
- 我们这里所说的head区域,是指页页html代码的<head>和</head>之间的内容。在以前的文章中,主要介绍了
- python将a.txt的内容复制到b.txt 中# 1. 用r方式打开a.txtf = open("a.txt",&q
- ES Module导出仅导出named exports: 命名导出,每次可以导出一个或者多个。default exports: 默认导出,每
- 先前我们讲的都是“线性结构”,他的特征就是“一个节点最多有一个”前驱“和一个”后继“。那么我们今天讲的树会是怎样的呢?我们可以对”线性结构“
- 由于刚刚学习python,对PyCharm也不是很熟悉,在成功运行多个死循环程序而没有关闭它的情况下,PyCharm成功的经常无响应,反应缓
- 有的时候,操作大文件,或者取数,要很久,我们给脚本首尾添加一段代码就知道,这段代码整体的大致运行时间了。import timestart =
- 我就废话不多说了,直接上代码吧!from time import sleepfrom threading importThreadimpor
- 有时候,进行了错误的提交,但是还没有push到远程分支,想要撤销本次提交,可以使用git reset –-soft/hard命令。1、二者区
- 第一步: 1:磁盘寻道能力,以高速硬盘(7200转/秒),理论上每秒寻道7200次.这是没有办法改变的,优化的方法是----用多个硬盘,或者
- 在开发过程中,收到这样一个问题反馈,在网站上传 100 MB 以上的文件经常失败,重试也要等老半天,这就难为需要上传大规格文件的用户了。那么
- 本文实例讲述了Python快速排序算法。分享给大家供大家参考,具体如下:快速排序的时间复杂度是O(NlogN)算法描述:① 先从序列中取出一
- 我在前几天的博客中翻译了一篇《20个对学习CSS3大有裨益的资源》的文章,其中推荐了Get started with CSS 3,本文为其中
- Pycurl包是一个libcurl的Python接口,由C语言编写的,功能强大,速度快。由于pycurl的属性和方法太多了,写这篇博文记录一
- 外键在 MySQL 中,表有两种引擎,一种是 InnoDB ,另外一种是 myisam 。如果使用的是 InnoDB 引擎,是支持外键约束的
- Form介绍在HTML页面中利用form表单向后端提交数据时,都会写一些获取用户输入的标签并且用form标签把它们包起来。与此同时我们在好多
- 依托于互联网的发达,我们可以随时随地利用一些等车或坐地铁的碎片时间学习以及了解资讯。同时发达的互联网也方便人们能够快速分享自己的知识,与相同
- 本文实例讲述了Django框架设置cookies与获取cookies操作。分享给大家供大家参考,具体如下:在Django里面,使用Cooki
- time库是python中处理时间的标准库。计算机时间的表达:time()、ctime()、gmtime();提供获取系统时间并格式化输出功
- f-string 字符串格式化语法f-string 是 Python 3.6 版本引入的一种新的字符串格式化语法。与其他字符串格式
- 这里就不给大家废话了,直接上代码,代码的解释都在注释里面,看不懂的也别来问我,好好学学基础知识去!# -*- coding: utf-8 -