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, see Section 4.2.6, “Using Option Files”.

Table 4.5 mysql Options

FormatOption FileDescriptionIntroducedRemoved
--auto-rehashauto-rehashEnable automatic rehashing  
--auto-vertical-outputauto-vertical-outputEnable automatic vertical result set display5.5.3 
--batchbatchDon't use history file  
--character-sets-dir=pathcharacter-sets-dirDirectory where character sets are installed  
--column-namescolumn-namesWrite column names in results  
--column-type-infocolumn-type-infoDisplay result set metadata  
--commentscommentsWhether to retain or strip comments in statements sent to the server  
--compresscompressCompress all information sent between client and server  
--connect_timeout=valueconnect_timeoutNumber of seconds before connection timeout  
--database=dbnamedatabaseThe database to use  
--debug[=debug_options]debugWrite a debugging log  
--debug-checkdebug-checkPrint debugging information when program exits  
--debug-infodebug-infoPrint debugging information, memory, and CPU statistics when program exits  
--default-auth=plugindefault-auth=pluginAuthentication plugin to use5.5.7 
--default-character-set=charset_namedefault-character-setSpecify default character set  
--defaults-extra-file=file_name Read option file in addition to usual option files  
--defaults-file=file_name Read only named option file  
--defaults-group-suffix=str Option group suffix value  
--delimiter=strdelimiterSet the statement delimiter  
--enable-cleartext-pluginenable-cleartext-pluginEnable cleartext authentication plugin5.5.27 
--execute=statementexecuteExecute the statement and quit  
--forceforceContinue even if an SQL error occurs  
--help Display help message and exit  
--host=host_namehostConnect to MySQL server on given host  
--htmlhtmlProduce HTML output  
--ignore-spacesignore-spacesIgnore spaces after function names  
--init-command=strinit-commandSQL statement to execute after connecting  
--line-numbersline-numbersWrite line numbers for errors  
--local-infile[={0|1}]local-infileEnable or disable for LOCAL capability for LOAD DATA INFILE  
--max_allowed_packet=valuemax_allowed_packetMaximum packet length to send to or receive from server  
--max_join_size=valuemax_join_sizeThe automatic limit for rows in a join when using --safe-updates  
--named-commandsnamed-commandsEnable named mysql commands  
--net_buffer_length=valuenet_buffer_lengthBuffer size for TCP/IP and socket communication  
--no-auto-rehash Disable automatic rehashing  
--no-beepno-beepDo not beep when errors occur  
--no-defaults Read no option files  
--no-named-commandsno-named-commandsDisable named mysql commands 5.5.3
--no-pagerno-pagerDeprecated form of --skip-pager 5.5.3
--no-teeno-teeDo not copy output to a file 5.5.3
--one-databaseone-databaseIgnore statements except those for the default database named on the command line  
--pager[=command]pagerUse the given command for paging query output  
--password[=password]passwordPassword to use when connecting to server  
--pipepipeOn Windows, connect to server using named pipe  
--plugin-dir=pathplugin-dir=pathDirectory where plugins are installed5.5.7 
--port=port_numportTCP/IP port number to use for connection  
--print-defaults Print defaults  
--prompt=format_strpromptSet the prompt to the specified format  
--protocol=typeprotocolConnection protocol to use  
--quickquickDo not cache each query result  
--rawrawWrite column values without escape conversion  
--reconnectreconnectIf the connection to the server is lost, automatically try to reconnect  
--safe-updatessafe-updatesAllow only UPDATE and DELETE statements that specify key values  
--secure-authsecure-authDo not send passwords to the server in old (pre-4.1.1) format  
--select_limit=valueselect_limitThe automatic limit for SELECT statements when using --safe-updates  
--shared-memory-base-name=nameshared-memory-base-nameThe name of shared memory to use for shared-memory connections  
--show-warningsshow-warningsShow warnings after each statement if there are any  
--sigint-ignoresigint-ignoreIgnore SIGINT signals (typically the result of typing Control+C)  
--silentsilentSilent mode  
--skip-auto-rehashskip-auto-rehashDisable automatic rehashing  
--skip-column-namesskip-column-namesDo not write column names in results  
--skip-line-numbersskip-line-numbersSkip line numbers for errors  
--skip-named-commandsskip-named-commandsDisable named mysql commands  
--skip-pagerskip-pagerDisable paging  
--skip-reconnectskip-reconnectDisable reconnecting  
--socket=pathsocketFor connections to localhost, the Unix socket file to use  
--sslsslEnable SSL for connection  
--ssl-ca=file_namessl-caPath of file that contains list of trusted SSL CAs  
--ssl-capath=dir_namessl-capathPath of directory that contains trusted SSL CA certificates in PEM format  
--ssl-cert=file_namessl-certPath of file that contains X509 certificate in PEM format  
--ssl-cipher=cipher_listssl-cipherList of permitted ciphers to use for SSL encryption  
--ssl-key=file_namessl-keyPath of file that contains X509 key in PEM format  
--ssl-verify-server-certssl-verify-server-certVerify server Common Name value in its certificate against host name used when connecting to server  
--tabletableDisplay output in tabular format  
--tee=file_nameteeAppend a copy of output to named file  
--unbufferedunbufferedFlush the buffer after each query  
--user=user_nameuserMySQL user name to use when connecting to server  
--verbose Verbose mode  
--version Display version information and exit  
--verticalverticalPrint query output rows vertically (one line per column value)  
--waitwaitIf the connection cannot be established, wait and retry instead of aborting  
--xmlxmlProduce 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.