MySQL Client tool

Source: Internet
Author: User
Tags mysql client

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

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.