MYSQL Connection Database Command collection

Source: Internet
Author: User
Tags deprecated mysql client rehash sql error x509 cert name database

First, MySQL connection to the local database, the user named "root", the password "123" (Note: "-P" and "123" can not have space between)

C:\>mysql-h Localhost-u root-p123

Second, MySQL connection remote database (192.168.0.201), port "3306", User name "root", password "123"

C:\>mysql-h 172.16.16.45-p 3306-u root-p123

Third, MySQL connection to the local database, the user named "root", Hidden password

C:\>mysql-h Localhost-u Root-p
Enter Password:

MySQL connection to the local database, the user name "root", specify the database connected to "test"

C:\>mysql-h localhost-u root-p123-d Test
Mysql>select database ();
+------------+
| Database () |
+------------+
| Test |
+------------+

The following is the detailed parameters of the MySQL client command:

MySQL Ver 14.12 distrib 5.0.41, for Win32 (IA32)
Copyright (C) 2002 MySQL AB
This software comes with absolutely NO WARRANTY. This is the free software,
And you is welcome to modify and redistribute it under the GPL license

Usage:mysql [OPTIONS] [Database]
-?,--Help Display this help and exit.
-I,--help synonym for-?
--auto-rehash Enable automatic rehashing. One doesn ' t need to use
' Rehash ' to get table and field completion, but startup
And reconnecting may take a longer time. Disable with
--disable-auto-rehash.
-A,--no-auto-rehash
No automatic rehashing. One have to use ' rehash ' to get
Table and field completion. This gives a quicker start of
MySQL and disables rehashing on reconnect. WARNING:
Options deprecated; Use--disable-auto-rehash instead.
-B,--batch Don ' t use the history file. Disable Interactive behavior.
(Enables--silent)
--character-sets-dir=name
Directory where character sets is.
--default-character-set=name
Set the default character set.
-C,--compress use compression in Server/client protocol.
-#,--debug[=#] This is a non-debug version. Catch This and exit
-D,--database=name database to use.
--delimiter=name delimiter to be used.
-E,--execute=name execute command and quit. (Disables--force and history
File
-E,--vertical Print the output of a query (rows) vertically.
-F,--force Continue even if we get an SQL error.
-G,--named-commands
Enable named Commands. Named commands mean this program ' s
Internal commands; See mysql> Help. When enabled, the
Named commands can used from any line of the query,
Otherwise only from the first line, before an enter.
Disable with--disable-named-commands. This option is
Disabled by default.
-G,--no-named-commands
Named commands is disabled. Use \* form only, or use
Named commands only in the beginning of a line ending
With a semicolon (;) Since Version 10.9 the client now
Starts with the option ENABLED by default! Disable with
'-G '. Long format commands still work from the first
Line. Warning:option deprecated; Use
--disable-named-commands instead.
-I,--ignore-spaces ignore space after function names.
--local-infile enable/disable LOAD DATA local infile.
-B,--no-beep Turn off beep on error.
-H,--host=name Connect to host.
-H,--html produce HTML output.
-X,--xml produce XML output
--line-numbers Write line numbers for errors.
-L,--skip-line-numbers
Don ' t write line number for errors. WARNING:-L is
Deprecated, use a long version of this option instead.
-N,--unbuffered Flush buffer after each query.
--column-names Write column names in results.
-N,--skip-column-names
Don ' t write column names in results. WARNING:-N is
Deprecated, use long version of the this options instead.
-O,--set-variable=name
Change the value of a variable. Please note the This
option is deprecated; Can set variables directly with
--variable-name=value.
--sigint-ignore Ignore SIGINT (CTRL-C)
-O,--one-database only update the default database. Useful for
Skipping updates to other database in the update log.
-P,--password[=name]
Password to use when connecting to server. If Password is
Not given it's asked from the TTY.
-W,--pipe use Named pipes to connect to server.
-P,--port=# port number to use for connection.
--prompt=name Set the MySQL prompt to this value.
--protocol=name the Protocol of Connection (Tcp,socket,pipe,memory).
-Q,--quick Don ' t cache result, print it row by row. This may slow
Down the server if the output is suspended. Doesn ' t use
History file.
-R,--raw Write fields without conversion. Used with--batch.
--reconnect Reconnect if the connection is lost. Disable with
--disable-reconnect. This option is enabled by default.
-S,--silent is more silent. Print results with a tab as separator,
Each row on the new line.
--shared-memory-base-name=name
Base name of shared memory.
-S,--socket=name socket file to use for connection.
--SSL Enable SSL for connection (automatically enabled with
Other flags). Disable with--skip-ssl.
--ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
--SSL).
--ssl-capath=name CA directory (check OpenSSL docs, implies--ssl).
--ssl-cert=name X509 cert in PEM format (implies--ssl).
--ssl-cipher=name SSL cipher to use (implies--ssl).
--ssl-key=name X509 key in PEM format (implies--ssl).
--ssl-verify-server-cert
Verify server ' s "Common Name" in its cert against
hostname used when connecting. This option was disabled by
Default.
-T,--table Output in table format.
-T,--debug-info Print some debug info at exit.
--tee=name Append everything into outfile. See Interactive Help (\h)
Also. Does not work in batch mode. Disable with
--disable-tee. This option was disabled by default.
--no-tee Disable outfile. See Interactive Help (\h) also. WARNING:
option deprecated; Use--disable-tee instead
-U,--user=name user for login if is not current user.
-U,--safe-updates only allow to UPDATE and DELETE that uses keys.
-U,--i-am-a-dummy synonym for option--safe-updates,-U.
-V,--verbose Write more. (-v-v-v gives the table output format).
-V,--version Output version information and exit.
-W,--wait wait and retry if connection are down.
--connect_timeout=# number of seconds before connection timeout.
--max_allowed_packet=#
Max packet length to send to, or receive from server
--net_buffer_length=#
Buffer for TCP/IP and socket communication
--select_limit=# Automatic limit for Select when using--safe-updates
--max_join_size=# Automatic limit for rows in a join when using
--safe-updates
--secure-auth refuse client connecting to server if it uses old
(pre-4.1.1) protocol
--show-warnings show warnings after every statement.

Default options is read from the following files in the given order:
C:\my.ini C:\my.cnf C:\WINDOWS\my.ini C:\WINDOWS\my.cnf D:\MySQL\my.ini D:\MySQL\my.cnf
The following groups is Read:mysql client
The following options may given as the first argument:
--print-defaults Print the program argument list and exit
--no-defaults do not read the default options from the any options file
--defaults-file=# only read default options from the given file #
--defaults-extra-file=# read this file after the global files is read

Variables (--variable-name=value)
and Boolean options {false| TRUE} Value (after reading options)
--------------------------------- -----------------------------
Auto-rehash TRUE
Character-sets-dir (No default value)
Default-character-set UTF8
Compress FALSE
Database (No default value)
delimiter;
Vertical FALSE
Force FALSE
Named-commands FALSE
Local-infile FALSE
No-beep FALSE
Host (No default value)
HTML FALSE
XML FALSE
Line-numbers TRUE
unbuffered FALSE
Column-names TRUE
Sigint-ignore FALSE
Port 3306
Prompt mysql>
Quick FALSE
Raw FALSE
Reconnect TRUE
Shared-memory-base-name (No default value)
Socket (No default value)
SSL FALSE
SSL-CA (No default value)
Ssl-capath (No default value)
Ssl-cert (No default value)
Ssl-cipher (No default value)
Ssl-key (No default value)
Ssl-verify-server-cert FALSE
Table FALSE
Debug-info FALSE
User (No default value)
Safe-updates FALSE
I-am-a-dummy FALSE
Connect_timeout 0
Max_allowed_packet 16777216
Net_buffer_length 16384
Select_limit 1000
Max_join_size 1000000
Secure-auth FALSE
Show-warnings FALSE

MYSQL Connection Database Command collection

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.