使用當前資料庫自定義 MySQL PS1

在 .bashrc 或 .bash_profile 中,新增:

export MYSQL_PS1="\u@\h [\d]>"

使 MySQL 客戶端 PROMPT 顯示當前使用者 @主機[資料庫]。

StackOverflow 文件