Mysql console program prompt string settings, learn mysql friends can refer.
Mysql console program prompt string settings, learn mysql friends can refer.
The prompt command reconfigures the default mysql> prompt. The string for defining the prompt can contain the following special sequences.
The default prompt for the mysql console program is "mysql>". The prompt can be modified as needed:
You can set these parameters as follows:
Set the shell environment variable: MYSQL_PS1
Shell> export MYSQL_PS1 = "(\ u @ \ h) [\ d]>"
Run the program startup Command Option: -- prompt
Shell> mysql -- prompt = "(\ u @ \ h) [\ d]>"
(User @ host) [database]>
Set the [mysql] section in the option file and add the prompt Option
[Mysql]
Prompt = (\ u @ \ h) [\ d]> \\_
Use the prompt (\ R) command in the mysql Program
Mysql> prompt (\ u @ \ h) [\ d]> \_
PROMPT set to '(\ u @ \ h) [\ d]> \_'
(User @ host) [database]>
(User @ host) [database]> prompt
Returning to default PROMPT of mysql>
Mysql>