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

FormatDescriptionIntroduced
--auto-rehashEnable automatic rehashing 
--batchDon't use history file 
--bind-address=ip_addressUse specified network interface to connect to MySQL Server5.1.22-ndb-6.3.4
--character-sets-dir=pathDirectory where character sets are installed 
--column-namesWrite column names in results 
--column-type-infoDisplay result set metadata5.1.14
--commentsWhether to retain or strip comments in statements sent to the server5.1.23
--compressCompress all information sent between client and server 
--connect_timeout=valueNumber of seconds before connection timeout 
--database=dbnameThe database to use 
--debug[=debug_options]Write a debugging log 
--debug-checkPrint debugging information when program exits5.1.21
--debug-infoPrint debugging information, memory, and CPU statistics when program exits 
--default-character-set=charset_nameSpecify default character set 
--defaults-extra-file=file_nameRead option file in addition to usual option files 
--defaults-file=file_nameRead only named option file 
--defaults-group-suffix=strOption group suffix value 
--delimiter=strSet the statement delimiter 
--execute=statementExecute the statement and quit 
--forceContinue even if an SQL error occurs 
--helpDisplay help message and exit 
--host=host_nameConnect to MySQL server on given host 
--htmlProduce HTML output 
--ignore-spacesIgnore spaces after function names 
--line-numbersWrite line numbers for errors 
--local-infile[={0|1}]Enable or disable for LOCAL capability for LOAD DATA INFILE 
--max_allowed_packet=valueMaximum packet length to send to or receive from server 
--max_join_size=valueThe automatic limit for rows in a join when using --safe-updates 
--named-commandsEnable named mysql commands 
--net_buffer_length=valueBuffer 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 
--pager[=command]Use the given command for paging query output 
--password[=password]Password to use when connecting to server 
--pipeOn Windows, connect to server using named pipe 
--port=port_numTCP/IP port number to use for connection 
--print-defaultsPrint defaults 
--prompt=format_strSet the prompt to the specified format 
--protocol=typeConnection 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 
--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_limit=valueThe automatic limit for SELECT statements when using --safe-updates 
--shared-memory-base-name=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 
--socket=pathFor connections to localhost, the Unix socket file to use 
--sslEnable SSL for connection 
--ssl-ca=file_namePath of file that contains list of trusted SSL CAs 
--ssl-capath=dir_namePath of directory that contains trusted SSL CA certificates in PEM format 
--ssl-cert=file_namePath of file that contains X509 certificate in PEM format 
--ssl-cipher=cipher_listList of permitted ciphers to use for SSL encryption 
--ssl-key=file_namePath 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 server5.1.11
--tableDisplay output in tabular format 
--tee=file_nameAppend a copy of output to named file 
--unbufferedFlush the buffer after each query 
--user=user_nameMySQL 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 is removed in MySQL 5.5.