This documentation is for an older version. If you're using the most current version, select the documentation for that version with the version switch in the upper right corner of the online documentation, or by downloading a newer PDF or EPUB file.

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.3 mysql Options

FormatDescriptionIntroduced
--auto-rehashEnable automatic rehashing 
--batchDo not use history file 
--character-sets-dirDirectory where character sets are installed 
--column-namesWrite column names in results 
--commentsWhether to retain or strip comments in statements sent to the server5.0.52
--compressCompress all information sent between client and server 
--connect_timeoutNumber of seconds before connection timeout 
--databaseThe database to use 
--debugWrite debugging log; supported only if MySQL was built with debugging support 
--debug-infoPrint debugging information, memory, and CPU statistics when program exits 
--default-character-setSpecify default character set 
--defaults-extra-fileRead named option file in addition to usual option files 
--defaults-fileRead only named option file 
--defaults-group-suffixOption group suffix value5.0.10
--delimiterSet the statement delimiter 
--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 
--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 
--no-pagerDeprecated form of --skip-pager 
--no-teeDo not copy output to a file 
--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 
--portTCP/IP port number to use for connection 
--print-defaultsPrint default options 
--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 server in old (pre-4.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 any5.0.6
--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 secure 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 connection encryption 
--ssl-keyPath of file that contains X509 key in PEM format 
--ssl-verify-server-certVerify server certificate Common Name value against host name used when connecting to server5.0.23
--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.

It is also possible to set variables by using --var_name=value. The --set-variable format is deprecated.