mysql prompt 修改登陆显示
2013-11-19 15:10
218 查看
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.2cto.com
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 -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.2cto.com
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
相关文章推荐
- 修改 SAP登陆界面旁边的显示内容
- 牛腩购物13: 整合用户资料修改 用户修改密码 asp.net登陆控件的使用(登录前 登陆后) 显示登录名 显示注销按钮
- 如何修改用户SSH\telnet登陆linux时候显示的欢迎信息
- 修改Windows登陆时显示上一次登陆的用户名
- 修改Windows 2000 开机画面 ++修改登陆背景
- 宝塔面板修改端口号无法登陆解决方案
- 利用HttpModuler实现WEB程序同一时间只让一个用户实例登陆(修改)
- 警惕黑客使用Lion系统漏洞破解和修改用户登陆密码
- 织梦默认分页样式修改 解决分页列表显示,去掉li
- Android登陆界面的简单实现(登陆背景渐变,密码点击隐藏与显示)
- 通过修改系统的$LANG解决xshell远程登录显示中文乱码的问题
- Intellij idea 修改IDE的界面的字体和显示样式
- 动态修改App显示图标
- 自定义Spinner--可以默认不选中,修改默认显示的spinner
- 【注册表】登陆时显示administrator用户
- 动态修改页面所有input是否可显示,是否可编辑
- 修改商品详细页-销售记录-买家名称和显示字数
- XtraGrid控件,实现在界面中动态修改列显示,列名列宽
- 20.IDA-修改二进制文件、显示修改点
- Linux命令之stty - 显示和修改终端行设置