MySQL--prompt

Source: Internet
Author: User
Tags percona server

MySQL--prompt modify command line link to MySQL prompt, Shell script example below

#!/bin/bash Case$1 inchCRM) cmd='Mysql-h192.168.1.2-uroot-proot-p3306-dcrm';;*)    Echo "database variable does not exist: Only input CRM is supported"Exit0;;EsacShift 1$cmd--prompt="[\[email protected]\h:\p (\d) \r:\m:\s] mysql>"--default-character-set=utf8-a"[email protected]"

On the command line, enter the DB CRM execution effect as follows

Liuzhao ~ $ DB CRMwarning:using a password on the command line interface can is insecure.  Welcome to the MySQL Monitor. CommandsEndWith , or \g.your MySQL connection ID is54706839Server Version:5.5.40-36.1-log Percona Server (GPL), Release 36.1, Revision 707Copyright (c)and/, Oracleor its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type ' help; ' or ' \h ' forHelp . Type ' \c ' to clear the current input statement. [Root @192.168.1.2:3306 (CRM) 16:59:15] mysql>

--prompt option list, the options used in the sample script are already marked red

\c A counter that increments for each statement you issue
\D Current date
\d Current database
\h Database Host
\l The current delimiter (new in 5.1.12)
\m Current Time (min)
\n A newline character
\O The current month in three-letter format (Jan, Feb, ...)
\o The current month in numeric format
\P am/pm
\p The current TCP/IP port or socket file port number
\R Current time (Hours)(0–23)
\r Current time (Hours)(1–12)
\S Semicolon
\s Current time (seconds)
\t A Tab character
\U

Your Full Account user_name@host_name name

\u Database user Name
\v The server version
\w The current day of the week in Three-letter format (Mon, Tue, ...)
\Y The current year, four digits
\y The current year, and the digits
\_ A Space
A space (a space follows the backslash)
\‘ Single quote
\" Double Quote
\\ A literal " \ " backslash character
\x

x, for any " x " not listed above

MySQL--prompt

Related Article

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.