mysql prompt的用法详解
发布时间:2024-01-28 07:30:32
标签: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


猜你喜欢
- osql 工具是一个 Microsoft Windows 32 命令提示符工具,您可以使用它运行 Transact-SQL 语句和脚本文件。
- 1._thread.start_new_thread(了解)import threadingimport timeimport _threa
- 功能:创建两个滑动条来分别控制高斯核的size和σσ的大小,这个程序是在阈值分割的那个程序上改动的。阈值分割程序在这 注意:由于σ=0σ=0
- 首先感谢朋友们对第一篇文章的鼎力支持,感动中....... 今天说的是选择排序,包括“直接选择排序”和“堆排序”。话说
- 比如: 搜索框:可以 <input value="搜索产品..." /> 文本区域: 可以 <text
- 一、继承的格式类的继承格式如下,括号中的为父类名。class 类名(父类名): 代码二、单继承下面我们让Man继承自Master类,并调用继
- 使用matplotlib中的一些函数将tensorflow中的数据可视化,更加便于分析import tensorflow as tfimpo
- 本篇主要讲述,如何在微信中打开自家页面后,弹窗请求用户授权,以便拿到用户的微信信息。首先说一下,完成自定义分享信息的,从无到有的流程:基础硬
- 在任何一个数据库中,查询优化都是不可避免的一个话题。对于数据库工程师来说,优化工作是最有挑战性的工作。MySQL开源数据库也不例外本站收录这
- 本文实例讲述了Python2与Python3的区别。分享给大家供大家参考,具体如下:python2与python3的区别1、性能2、编码格式
- calccalc 是一个我们想要做剖析(性能分析)的异步函数。按照惯例,它的最后一个参数是一个callback。我们像这样使用 calc:c
- 下面我们学习if语句,输入下面的代码,确保能够正确运行。people = 20 cats = 30 dogs = 15 if people
- 背景go中map数据结构不是线程安全的,即多个goroutine同时操作一个map,则会报错,因此go1.9之后诞生了sync.Mapsyn
- 本文中的示例主要是解决在函数间不能传递多个(32个以上)参数的问题,解题的具体思路就是采用记录类型作为函数的输入和返回值,所以我们需要先定义
- 1、背景在项目中,我们经常使用到update语句,那么update语句会锁定表中的那些记录呢?此处我们通过一些简单的案例来模拟下。此处是我自
- TensorFlow中的log共有INFO、WARN、ERROR、FATAL 4种级别。有以下几种设置方式。1. 通过设置环境变量控制log
- slice:eg:>>>e=[0,1,2,3,4,5,6]>>>s=slice(2,3)>>
- 存储过程的概念 存储过程Procedure是一组为了完成特定功能的SQL语句集合,经编译后存储在数据库
- 思路整理:1、进入心灵鸡汤网页,使用python获取心灵鸡汤内容2、登陆微信,找到需要发送的朋友3、发送获取的内容1、获取心灵鸡汤的内容如下
- 今天来分享一个“高大上”的技术——使用python编写一个可以用微信远程控制电脑的程序!先来分析一下控制的具体流程:我们使用微信给特定的邮箱