MySQL command line arguments

Source: Internet
Author: User
Tags rehash sql error mysql command line ssl connection

One, MySQL command line arguments

Usage:mysql [OPTIONS][Database]Command mode
-?,--help//Display assistance information and exit
-I,--HELP//Display Help information and exit
--auto-rehash//Auto-complete function, like Linux inside, press the TAB key out of the same, the following examples

-A,--no-auto-rehash//default state is not auto-complete function. -A is not auto-complete function
-B,--batch//ysql do not use history files, disable interaction
--character-sets-dir=name//Font Set installation directory
--default-character-set=name//Setting the default character set for the database
-C,--compress//use compression when passing information on client and server side
-#,--debug[=#]//bug invoke function
-D,--database=name//which database to use
--delimiter=name//mysql The default command terminator is a semicolon, below is an example
-E,--execute=name//execute MySQL SQL statement
-E,--vertical//Vertical print query output
-F,--force//If there is an error jumping over, continue to perform the following
/*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.*/
/*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//ignores the spaces following the function name.
--local-infile//Start/disable LOAD DATA local infile.
-B,--no-beep//sql error, no beep
-H,--host=name//Set the server name or IP of the connection
-H,--html//output in HTML
-X,--xml//output in XML
--line-numbers//Display the wrong line number
-L,--skip-line-numbers//Ignore wrong line number
-N,--unbuffered//flush cache after every SQL execution
--column-names//Display column information on search, plus by default
-N,--skip-column-names//Do not display column information
-O,--set-variable=name//Set Variable usage is--set-variable=var_name=var_value
--sigint-ignore//Ignore SIGINT symbol (results of control-c when logging out)
-O,--one-database//ignores statements except for the default database named in the command line. You can help skip updates to other databases in the log.
--pager[=name]//Use a pager to display the query output, this to Linux can be used more,less and so on.
--no-pager//Do not use a paging device to display the query output.
-P,--password[=name]//Enter password
-P,--port=#//Set port
--prompt=name//Set MySQL prompt
--protocol=name//What protocol to use
-Q,--quick//Do not cache the results of the query, sequentially print each row. If the output is suspended, the server slows down and MySQL does not use the history file.
-R,--raw//writes the value of the column without escaping the conversion. Typically used in conjunction with the--batch option.
--reconnect//If the connection to the server is broken, automatically attempt to reconnect. No reconnection, use--disable-reconnect.
-S,--silent//one-line output, tab-delimited in the middle
-S,--socket=name//Sockey file for connection server
--SSL//Activate SSL connection, do not activate--skip-ssl
--ssl-ca=name//CA Certificate
--ssl-capath=name//ca Path
--ssl-cert=name//x509 Certificate
--ssl-cipher=name//ssl cipher To use (implies--ssl).
--ssl-key=name//x509 Key Name
--ssl-verify-server-cert//The certificate of the audit server when connected
-T,--table//in tabular situation output
--tee=name//Add the output copy to the given file, when forbidden with--disable-tee
--no-tee//root--disable-tee function same
-U,--user=name//user name
-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//output MySQL execution statement
-V,--version//version information
-W,--wait//server down, wait until the restart time
--connect_timeout=#//Time to wait before connecting
--max_allowed_packet=#//server receive/Send packet maximum length
--net_buffer_length=#//TCP/IP and socket communication buffer size.
--select_limit=#//Automatic restriction of SELECT statements when using--safe-updates
--max_join_size=#//automatic restriction of rows in joins when using--safe-updates
--secure-auth//Deny connect to database (pre-4.1.1)
--server-arg=name//send Embedded Server this as a parameter.
--show-warnings//Display warning

MySQL command line arguments

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: 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.