4.5.1.1 mysql Options

mysql supports the following options, which can be specified on the command line or in the [mysql] and [client] groups of an option file. For information about option files used by MySQL programs, see Section 4.2.6, “Using Option Files”.

Table 4.6 mysql Options

FormatDescriptionIntroducedRemoved
--auto-rehashEnable automatic rehashing  
--auto-vertical-outputEnable automatic vertical result set display5.5.3 
--batchDon't use history file  
--character-sets-dirDirectory where character sets are installed  
--column-namesWrite column names in results  
--column-type-infoDisplay result set metadata  
--commentsWhether to retain or strip comments in statements sent to the server  
--compressCompress all information sent between client and server  
--connect_timeoutNumber of seconds before connection timeout  
--databaseThe database to use  
--debugWrite a debugging log  
--debug-checkPrint debugging information when program exits  
--debug-infoPrint debugging information, memory, and CPU statistics when program exits  
--default-authAuthentication plugin to use5.5.7 
--default-character-setSpecify default character set  
--defaults-extra-fileRead option file in addition to usual option files  
--defaults-fileRead only named option file  
--defaults-group-suffixOption group suffix value  
--delimiterSet the statement delimiter  
--enable-cleartext-pluginEnable cleartext authentication plugin5.5.27 
--executeExecute the statement and quit  
--forceContinue even if an SQL error occurs  
--helpDisplay help message and exit  
--hostConnect to MySQL server on given host  
--htmlProduce HTML output  
--ignore-spacesIgnore spaces after function names  
--init-commandSQL statement to execute after connecting  
--line-numbersWrite line numbers for errors  
--local-infileEnable or disable for LOCAL capability for LOAD DATA INFILE  
--max_allowed_packetMaximum packet length to send to or receive from server  
--max_join_sizeThe automatic limit for rows in a join when using --safe-updates  
--named-commandsEnable named mysql commands  
--net_buffer_lengthBuffer size for TCP/IP and socket communication  
--no-auto-rehashDisable automatic rehashing  
--no-beepDo not beep when errors occur  
--no-defaultsRead no option files  
--no-named-commandsDisable named mysql commands 5.5.3
--no-pagerDeprecated form of --skip-pager 5.5.3
--no-teeDo not copy output to a file 5.5.3
--one-databaseIgnore statements except those for the default database named on the command line  
--pagerUse the given command for paging query output  
--passwordPassword to use when connecting to server  
--pipeOn Windows, connect to server using named pipe  
--plugin-dirDirectory where plugins are installed5.5.7 
--portTCP/IP port number to use for connection  
--print-defaultsPrint defaults  
--promptSet the prompt to the specified format  
--protocolConnection protocol to use  
--quickDo not cache each query result  
--rawWrite column values without escape conversion  
--reconnectIf the connection to the server is lost, automatically try to reconnect  
--i-am-a-dummy, --safe-updatesAllow only UPDATE and DELETE statements that specify key values  
--secure-authDo not send passwords to the server in old (pre-4.1.1) format  
--select_limitThe automatic limit for SELECT statements when using --safe-updates  
--shared-memory-base-nameThe name of shared memory to use for shared-memory connections  
--show-warningsShow warnings after each statement if there are any  
--sigint-ignoreIgnore SIGINT signals (typically the result of typing Control+C)  
--silentSilent mode  
--skip-auto-rehashDisable automatic rehashing  
--skip-column-namesDo not write column names in results  
--skip-line-numbersSkip line numbers for errors  
--skip-named-commandsDisable named mysql commands  
--skip-pagerDisable paging  
--skip-reconnectDisable reconnecting  
--socketFor connections to localhost, the Unix socket file to use  
--sslEnable SSL for connection  
--ssl-caPath of file that contains list of trusted SSL CAs  
--ssl-capathPath of directory that contains trusted SSL CA certificates in PEM format  
--ssl-certPath of file that contains X509 certificate in PEM format  
--ssl-cipherList of permitted ciphers to use for SSL encryption  
--ssl-keyPath of file that contains X509 key in PEM format  
--ssl-verify-server-certVerify server Common Name value in its certificate against host name used when connecting to server  
--tableDisplay output in tabular format  
--teeAppend a copy of output to named file  
--unbufferedFlush the buffer after each query  
--userMySQL user name to use when connecting to server  
--verboseVerbose mode  
--versionDisplay version information and exit  
--verticalPrint query output rows vertically (one line per column value)  
--waitIf the connection cannot be established, wait and retry instead of aborting  
--xmlProduce XML output  

You can also set the following variables by using --var_name=value. The --set-variable format is deprecated and was removed in MySQL 5.5.3.