mysql prompt的用法详解
prompt命令可以在mysql提示符中显示当前用户、数据库、时间等信息
mysql -uroot -p --prompt="\\u@\\h:\\d \\r:\\m:\\s>"
设置成功后:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.60-log Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
root@localhost:(none) 11:04:23>
也可以在在my.cnf配置文件里进行配置:
[mysql]
prompt=mysql(\\u@\\h:\\d)>
default-character-set=utf8
选项说明:
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 www.jb51.net
Your full user_name@host_name account name
\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
\x
x, for any “x” not listed above
mysql prompt的用法详解的更多相关文章
- MySQL自定义函数用法详解-复合结构自定义变量/流程控制
自定义函数 (user-defined function UDF)就是用一个象ABS() 或 CONCAT()这样的固有(内建)函数一样作用的新函数去扩展MySQL. 所以UDF是对MySQL功能的一 ...
- Mysql中timestamp用法详解
前言:时间戳(timestamp),一个能表示一份数据在某个特定时间之前已经存在的. 完整的. 可验证的数据,通常是一个字符序列,唯一地标识某一刻的时间.使用数字签名技术产生的数据, 签名的对象包括了 ...
- MySQL数据类型DECIMAL用法详解
MySQL DECIMAL数据类型用于在数据库中存储精确的数值.我们经常将DECIMAL数据类型用于保留准确精确度的列,例如会计系统中的货币数据. 要定义数据类型为DECIMAL的列,请使用以下语法: ...
- mysql中event的用法详解
一.基本概念mysql5.1版本开始引进event概念.event既“时间触发器”,与triggers的事件触发不同,event类似与linux crontab计划任务,用于时间触发.通过单独或调用存 ...
- Mysql导入导出工具Mysqldump和Source命令用法详解
Mysql本身提供了命令行导出工具Mysqldump和Mysql Source导入命令进行SQL数据导入导出工作,通过Mysql命令行导出工具Mysqldump命令能够将Mysql数据导出为文本格式( ...
- [转]Mysql导入导出工具Mysqldump和Source命令用法详解
Mysql本身提供了命令行导出工具Mysqldump和Mysql Source导入命令进行SQL数据导入导出工作,通过Mysql命令行导出工具Mysqldump命令能够将Mysql数据导出为文本格式( ...
- Mysql中limit的用法详解
Mysql中limit的用法详解 在我们使用查询语句的时候,经常要返回前几条或者中间某几行数据,为我们提供了limit这样一个功能. SELECT * FROM table LIMIT [offset ...
- mysql配置文件my.cnf详解
原文地址:mysql配置文件my.cnf详解 作者:gron basedir = path 使用给定目录作为根目录(安装目录). character-sets-dir = path 给出存放着字符集的 ...
- CentOS7下Firewall防火墙配置用法详解
官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...
随机推荐
- 自定义Dialog布局的弹窗功能的简单实现
package com.loaderman.dialogdemo; import android.os.Bundle; import android.support.v7.app.AlertDialo ...
- ROC曲线详解
转自https://blog.csdn.net/qq_26591517/article/details/80092679 1 ROC曲线的概念 受试者工作特征曲线 (receiver operatin ...
- git 参考手册-简明指南
很久没发文了,来头条以后更忙了,也没精力去分享一些有营养的内容了.这次分享的 git 的方方面面,基本来自于我的笔记.git 这东西算是为数不多每天都要用的东西了,但是我觉得也不至于从头至尾去了解他的 ...
- 05 vue-cli如何运行
一.index.html index.html跟其他html一样,只有一个空的根节点,提供main.js用来挂载实例,所有内容通过vue来填充. 二.main.js main.js主要是引入vue框架 ...
- NJCTF (easycrack)
安装app查看.一个输入框,输入随便输入显示Try again. 放入JEB反编译. 关于输入框监听是第一次见,具体可以看看这个博客https://www.jianshu.com/p/f976c677 ...
- 积累-T
emmm,各种知识点都有吧,主要方便自己记 随机修改网页图标 <script> var image=new Array(3); image.length=3; image[1]=" ...
- VMware Workstation 15 Pro简化安装Kali Linux 2019.2
记录下简单安装的步骤
- elasticsearch 7.x 如何满足mysql中的模糊查询功能(like)
业务场景:筛选项原功能是用mysql左模糊进行过滤查询,现业务要用es,怎么样才能满足原功能,又不损性能. elasticsearch中有关于模糊查询的操作:wildcard 文档:https://b ...
- Go语言流程控制(六)
go语言的流程控制主要有if , for和switch. if else(分支结构) go语言的if判断: func main() { score:=65 if score>=90{ fmt.P ...
- rabbitmq五种消息模型整理
目录 0. 配置项目 1. 基本消息模型 1.1 生产者发送消息 1.2 消费者获取消息(自动ACK) 1.3 消息确认机制(ACK) 1.4 消费者获取消息(手动ACK) 1.5 自动ACK存在的问 ...