Sunday, April 17, 2005

Chang the Mysql client prompt

Changing the Mysql client prompt: (Mysql 4.0.2 and higher)

(from http://dev.mysql.com/doc/mysql/en/mysql_Commands.html)

e.g. "prompt \d\R\m>" will show the current database + millitary hour + minutes

Put in my.cnf

[mysql]
prompt="\\d\\R\\m>"

1 comment:

Anonymous said...

this setting should actually come under the [client] section in the cnf file. i.e.

[client]
prompt = \u@\h|\d

which gives
user@host|database