Create your own MySQL prompt

Source: Internet
Author: User
Tags mysql client

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.