MySQL client-Introduction to MySQL and Mysqldump tool usage

Source: Internet
Author: User
Tags thread stop

One, MySQL use:

MySQL tool is the official MySQL connection tool, the user can connect to the MYSQLD via MySQL a series of SQL operations. There are two modes of the MySQL tool: interactive mode and command line mode. The interactive mode directive requires a connection to the MySQL server release, and the command-line mode reads the command-line pass-through to the server through specific (-e) parameters.

Command-line arguments for 1.MYSQL clients:

There are many parameters to the MySQL client, but there are only a few common ones:

MySQL [OPTIONS] [database]   -?,--                       help Display helper Information   -E,--execute=name               executes the specified command, command  -line mode -u,--user=name                  Specify user  -H for the connection ,--host=name specifies the                  host name   -P,--password specifies the                   password
-P,--port specified port
2.mysql Interactive mode common directives:

There are two types of instructions for the MySQL interactive mode: Client directives and server-side directives. Where the client instruction is the built-in instruction of the MySQL tool, the server-side instruction is the operation instruction provided by the MYSQLD service, we only introduce the client instruction.

      Help (\h) for assistance
Connect (\ r) Reconnect delimiter (\d) sets the terminator of the service-side statement, by default the semicolon ego (\g) sends the instruction to the server, equals the statement terminator, but displays the exit as a column (\q) Exit MySQL client go (\g) Send instruction to server, equals statement Terminator quit (\q) exit Mysqlsource (\.) Execute SQL Script status on System (\s) Get basic information about the MySQL service system (\!) Execute shell command tee (\ t) shunt output use (\u) The warning message for the selected database CharSet (\c) toggle Character Set Warnings (\w) statement is displayed nowarning (\W) does not display the statement's warning message

Note: The service-side instruction execution requires specifying the terminator, which MySQL does not need, and the default terminator is a semicolon.

3.mysql interactive mode shortcut keys:
CTRL +W: Delete the word before the cursor ctrl+u: Delete all content before the cursor to the beginning of the command Ctrl+y: Paste the previously deleted content Ctrl+  A: Move cursor to beginning CTRL+E: Move cursor to end of line

Second, mysqladmin use:

Unlike MySQL, Mysqladmin is the official MySQL shell command-line tool (MySQL is the connection tool), and its parameters need to be executed on the shell command line. Mysqladmin provides two types of parameters: Connection parameters and command parameters, which are used to specify connection information, and command parameters are service commands.

1.mysqladmin Common Connection parameters:
mysqladmin [OPTIONS] Command command ....
OPTIONS:
-U,--user=name Specifies the user name -H,--host=name specifies the hostname -P,--password Specifies the password -P,--port specified port
2.mysqladmin Common Command parameters:
mysqladmin [OPTIONS] Command command ....
COMMAND:
Create [db_name] drop [db_name] debug Open debug Log and log in error log status Basic status information for the output server--Sleep: The status of the sub-parameters, how often refreshed once--count:status Sub-parameters, showing the batch extended-status Displays the extended state information, equal to: Show GLOBAL status; Flush-Hosts empties host-related caches, including: DNS resolution cache, excessive number of connection errors, and hosts denied access to mysqld. Flush-logs Close the log, open a new log to scroll flush for binary, trunk log-Privileges Refresh Configuration flush-status Reset state variable flush-tables closes the currently open Table file handle flush-threads emptying the thread cache poolKillkills the specified thread password modifies the password of the specified userPingwhether the probe server is online processlist displays the list of MySQL threads reload equivalent to flush-privileges Refresh is equivalent to using flush at the same time-logs and flush-hosts shutdown shutdown mysql service start-slave boot from server thread stop-slave shutdown server variable version from server thread variables output mysqld Show MySQL server version

MySQL client-Introduction to MySQL and Mysqldump tool usage

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.