MySQL client tools and the use of MySQL client commands and Mysqladmin

Source: Internet
Author: User
Tags rehash

MySQL Client Tools

used in MySQL The client tools have these:

MySQL: This is a command line client tool that is installed in the MySQL server, a command-line tool is automatically installed.

mysqldump: This is used to back up MySQL Client tools to use when using the

mysqladmin: This is a more commonly used MySQL client-side management tools, powerful features, will be introduced later

Mysqlcheck

Mysqlimport

MySQL command: MySQL client commands and server-side commands

login to using account and password mysql command to get all the mysql client command, of course, here's mysql command without a query and other sql command. where mysql Common client commands have these:

Note: MySQL A statement Terminator cannot be followed after a client command

\c: Early Termination SQL statement Execution (cannot precede user terminator)

\d: Define statement terminator, default to semicolon ";"

\s: Get status information for a server

      \. Sqltfile: execute SQL script file

\q: Exit MySQL Process

\h KEYWORD: get command Help

\g: regardless of the statement terminator, send this statement 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 fashion

      \! Command: You can execute shell commands

\w: display a warning message when the statement ends

      \#: support for new objects with full complement functionality

server-side commands are our common query, delete, modify, insert, create, etc. SQL Statement

Note MySQL the server-side command must be followed by a statement terminator, and the default statement terminator is a semicolon ";" .

If you use a server-side command that you forgot, you can use the Help command to view.

Help KEYWORD you can get the use format for related keywords

For example: mysql> Help Select

Mysql the meaning of the cue symbol

mysql> represents the beginning of a new statement

→ indicates wait for input next line statement

' > represents waiting for another single quotation mark to end as the statement

"> represents waiting for another double quote to end as the statement

' > indicates waiting for another counter quote to end as the statement

/*> represents waiting for a statement to be entered in the comment specifier (*/) End as comment for the statement

Mysql Auto-complete function

1. Turn off the auto-completion feature of MySQL

using Commands -A {--no-auto-rehash|--disable-auto-rehash}

Example:mysql> use mysql-a--no-auto-rehash

Auto-complete function can be turned on or off relative to library or table

2. turn on auto-complete function

mysql> \# or mysql> Rehash

mysqladmin the Use

mysqladmin is a client-side tool for managing MySQL server, it is very powerful and is a very common and useful client management tool.

mysqladmin The syntax format is as follows:

mysqladmin [option] command [ARG] [command [ARG]] ...

Option

- u useranme: which user's account is used to manage

- P : password-related options

COMMAND:

Password ' new_password ': used to modify a user's password

For example: mysqladmin–u root–p password ' ABCD '

Create DATABASE: Create a library

Drop DATABASE : Deletes the specified library

Ping: can be used to check MySQL server-side is online

processlist:x Displays the active MySQL thread information, equivalent to executing SHOW processlist; Statement

Statues:These global state variables and their values are displayed, and these global state variables are:Uptime,Threads,Questions,Slow Queries,Opens,Flush Tables,Open Tables,Queries per second avg

where status has 2 sub-options:

--sleep NUM: show once every few seconds

--count: How many times does it show?

Extended-status: display server state variables and their values

variables: display server variables and their values

flush-privileges: Let mysqld reread authorization form, equivalent to Reload

Flush-status: Reset Most server state variables

Flush-logs: generate binary and trunk log scrolling

flush-hosts: refreshes the cache information on the host

Refresh: equivalent to simultaneous execution flush-hosts and the Flush-logs

Shutdown: Close MySQL Server Process

version: Displays the server version and its current status information

Start-slave: start replication and start the replication thread from the server.

Stop-slave: Turn off the replication feature

This article is from the "Linux Learning path" blog, so be sure to keep this source http://xslwahaha.blog.51cto.com/4738972/1576255

MySQL client tools and the use of MySQL client commands and Mysqladmin

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.