Use of the MySQL client tool

Source: Internet
Author: User
Tags mysql client

Mysql>

Mysql

--user,-u

--host,-h

--password,-p

--port

--protocol

--database database,-d


Other options:

--compress statements are first compressed in return, saving bandwidth


Mysql>

Interactive mode

Batch processing mode (script mode)

MySQL < init.sql: input a bunch of commands into MySQL


mysql> \. /root/test/sql



Mysql>

Two types of commands:

Client command:

Server statement: There is a statement terminator, the default is;

\? Get List of client commands

\c Early Termination statement execution

\d Define line breaks identifier

\ r Reconnect to the MySQL server, display the currently open database, and display the connection ID

\g no matter what the statement terminator is, send the statement directly to the server for execution

\g no matter what the statement Terminator is, the statement is sent directly to the server-side execution and is displayed directly in a vertical row

\! Execute shell command

\w: A warning message is displayed after the statement execution is completed;

\w: Do not display warning messages

\#: Support completion for newly created objects


Mysql>

--statement not ended can continue to enter

' > The latter half of the missing single quotes

"> The latter half of the missing double quotes

' > The back half of the missing anti-quote

/*> The latter half of a multiline comment is missing


Completion:

Name completion

-A disables the completion function (used when connecting to MySQL)


Server-side commands:

Columns such as Help select Get assistance for the SELECT command


Mysqladmin Status Server State command


--sleep 2 two seconds display once

--count 2 show only 2 times


Mysqladmin extended-status Display state variables

Mysqladmin variables Display Server variables

Flush Privileges Refresh Authorization Form

Flush tables Close all open tables

Flush Flush-threads Clearing Idle threads

Flush-status resetting most of the server state variables

Flush-logs binary and Trunk log scrolling

Flush-hosts clear the internal information of the host

Refresh equals simultaneous execution of flush-hosts and Flush-logs

Shutdown shutting down the MySQL server process

Version server versions and current status information

Start-slave start replication, start a replication thread from the server

SQL thread

IO thread

Stop-slave

Mysqldump, Mysqlimport, Mysqlcheck



This article from "Operation and maintenance Growth Road" blog, declined reprint!

Use of the MySQL client tool

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.