When you connect to the server through the MySQL client, you do not know which database is currently in the management. The following is done by defining prompt. Just add the following to your MY.CNF [MySQL]:
Prompt=\\[email protected]\\d \\r:\\m\\_>
Note: Find out which location of your MySQL call is my.cnf, and don't get it wrong.
Log in to the MySQL server using the MySQL client. The default is similar to the following:
[Email protected] (none) 03:16 >
into a db.
[Email protected] (none) 03:16 >use TestDB;
Reading table information for completion of table and column names
Can turn off this feature to get a quicker startup with-a
Database changed
[Email protected] TestDB 03:16 >
As you can see, the front is the current account root,@ followed by the database name. is not very convenient. If you want to do more customization, Baidu "MySQL prompt." Let's go play.
This article is from the "Passing" blog, please be sure to keep this source http://swenzhao.blog.51cto.com/3451741/1868962
Create your own MySQL prompt