mysql prompt的用法详解_MySQL
程序员文章站
2022-06-12 22:00:19
...
bitsCN.com
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
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
推荐阅读
-
MYSQL数据表损坏的原因分析和修复方法小结
-
实现MySQL的a-b
-
JAVA中利用JDBC实现连接Mysql的操作
-
php提示Warning:mysql_fetch_array() expects的解决方法
-
php如何把mysql 的查询结果形成数字,有啥方便的办法。
-
mysql 存储过程中使用了游标和临时表,返回的临时表数据不准确
-
php与Mysql的一些简单的操作,phpmysql
-
Mysql 的存储引擎,myisam和innodb的区别_MySQL
-
(mysql)怎样判断一个数字变量是否包含在表的一个字段中,并列出包含该变量的表中所有数据.该如何处理
-
区分MySQL中create table as 和 create table like的用法