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