MySQL Client tool
Mysql
--user,-U
--host,-H
--password,-P
--port
--protocol
--database database,-D
--html-h displaying results using HTML format
--xml-x displaying results using XML format
Other options:
--compress
Mysql>
Interactive mode
Batch processing mode (script mode)
MySQL < Init.sql
source or \. To load the script on the file system
Mysql>
Two types of commands:
Client commands
Server statement: There is a statement terminator, default;
Delimiter \d: Defining a statement Terminator
Client command:
\c: Early termination of statement execution
\g: Regardless of the statement Terminator, the statement is sent directly to the server-side execution;
\g: Regardless of the statement Terminator, the statement is sent directly to the server-side execution, and the results are displayed in a vertical manner;
\! Command: Execute shell command
\w: A warning message is displayed after the statement execution is completed;
\#: The new object, support the completion of the function;
Mysql> can enter new lines
The previous line is not over yet
' > is missing a single quote
"> is missing a double quote
' > is missing an anti-quote
Server-side commands get help:
Help KEYWORD Example: Mysql>help Select
# mysqladmin [options] command [ARG] [command [ARG]] ...
To change the root password:
# mysqladmin-uroot-p password ' new_pass '
Common options for Mysqladmin:
Create DATABASE
Drop DATABASE
Ping test server is online
Processlist List Server All threads
Status
--sleep N: Display frequency
--count N: Show multiple states
Extended-status: Show state variables
Variables: Display server variables
Flush-privileges: Let mysqld reread authorization form, equivalent to reload;
Flush-status: Resetting most server state variables
Flush-table: Close all open tables
Flush-threads: Resetting the thread cache
Flush-logs: binary and Trunk log scrolling
Flush-hosts: Clear host internal information (such as DNS cache and user denied login)
Refresh: Equivalent to simultaneous execution of flush-hosts and Flush-logs
Shutdown: Shutting down the MySQL server process
Version: Server versions and current status information;
Start-slave: Initiating replication (starting a replication thread from the server)
SQL thread
IO thread
Stop-slave: Turn off replication;
Mysqldump, Mysqlimport, Mysqlcheck
This article is from the "bustling Down" blog, please be sure to keep this source http://chenxujiang.blog.51cto.com/11737025/1846007
MySQL Client tool