How to change the prompt information under the mysql command _ MySQL

Source: Internet
Author: User
How to change the prompt information under the mysql command we often encounter this problem you are still in your MySQL command mode, the previous prompt information is:

MySQL>, how do we change the prompt information under the mysql command?

In this way, you do not know which database is selected, which user is used to log on, and which server is used to log on. In fact, you only need to add a parameter during logon.

Normal logon is:

MySQL-h localhost-u root-p

You only need to add -- prompt = "prefix" to this information. The command is as follows:

MySQL-h localhost-u root-p -- prompt = "/u @/h:/d:/m/s>"

After you log on to the console, the following information is displayed:

Root @ localhost: 05:03:00>

Where Is the database you selected. Currently, the database is not selected, so it is none. if you select a database:
Use lyb;

The following figure is displayed:

Root @ localhost: Maid 05:03:00>

Haha, isn't that much more convenient?

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.