Before knowing of this MySQL feature, whenever I was working on a database I always use the \s
command to verify which database I was about to alter. Instead of using this command, MySQL client has a prompt global variable which lets you modify the display prompt when connecting to a MySQL server.
Simply add the following entries to my.cnf
[mysql]
prompt='[db: \d] ‘