MySQL command line arguments

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

MySQL command line arguments

Usage:mysql [OPTIONS] [Database] //Command mode

For example:

Mysql-h${hostname}-p${port}-u${username}-p${password}-D ${dbname}- e "${create_table_sql}"

-?,--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

-A,--no-auto-rehash//default state is not auto-complete function. -A is not auto-complete function
-B,--batch//mysql 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 default command terminator is semicolon
-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

-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 the wrong line number  
-N,--unbuffered//after each execution of SQL, refreshes the cache  
--column-names//Lookup When column information is displayed, The default is add  
-N,--skip-column-names//Do not display column information  
-O,--set-variable=name//Set Variable usage Yes--set-variable=var_name =var_value 
--sigint-ignore//Ignore SIGINT symbol (CONTROL-C results 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. &NBSP
--pager[=name]//Use a pager to display the query output, which can be used in Linux more,less and so on.  
--no-pager//Do not use a pager to display 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 try to reconnect. No reconnection, use--disable-reconnect.  
-S,--silent//one-line output, tab-delimited   in the middle,
-S,--socket=name//connection server Sockey file  
--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//Connection Audit server certificate  

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