How to Use the mysql prompt to clearly manage the database

Source: Internet
Author: User
As you manage more and more mysql servers, the same mysql prompt may allow you to enter wrong commands to the wrong database. At this time, you need to use the mysql prompt, this is my prompt root @ localhost (mysql) 08:55:21 using prompt command implementation (applicable to windows and linux environments)

As you manage more and more mysql servers, the same mysql prompt may allow you to enter wrong commands to the wrong database. At this time, you need to use the mysql prompt, this is my prompt root @ localhost (mysql) 08:55:21 using prompt command implementation (applicable to windows and linux environments)

Mysql> prompt \ u @ \ h (\ d) \ r: \ m: \ s>

\ U: connected to the user

\ H: connect to the host

\ D: connect to the database

\ R: \ m: \ s: display the current time

Mysql> prompt \ u @ \ h (\ d) \ r: \ m: \ s>

Root @ localhost (mysql) 08:55:21> status
--------------
Mysql Ver 14.14 Distrib 5.1.33, for Win32 (ia32)

Connection id: 2
Current database: mysql
Current user: root @ localhost
SSL: Not in use
Using delimiter :;
Server version: 5.1.33-community-log MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: gb2312
Db characterset: gb2312
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Uptime: 6 min 6 sec

Threads: 2 Questions: 867 Slow queries: 0 Opens: 129 Flush tables: 1 Open t
Ables: 9 Queries per second avg: 2.368
--------------

Root @ localhost (mysql) 08:55:29>

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.