prompt更改MySQL登陆后的提示符

临时生效

mysql> prompt \u@standby \r:\m:\s >
PROMPT set to '\u@standby \r:\m:\s >'
root@standby 11:30:57 >
root@standby 11:30:58 >

永久生效

更改配置文件:my.cnf

[mysql]
prompt="\\r:\\m:\\s> "


[mysql]
no-auto-rehash
prompt="\\U \\r:\\m:\\s> "
[root@standby ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.72 Source distribution

Copyright (c) 2000, 2013, 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 10:23:30> 
root@localhost 10:23:32>

  

posted @ 2017-07-13 00:21  青山应回首  阅读(430)  评论(0编辑  收藏  举报