Mysql:mysql.exe命令行客户端

概述

  • mysql.exe可以运行在 {交互模式|非交互模式}。在交互模式下,查询结果以ascii表的形式展现;在非交互模式下,可以通过选项来是查询结果以{tab分割的文本 | xml | html |等等}展现;非交互模式是通过管道转向来实现的!
  • 如果因为查询结果过大而致使内存不足问题出现:可以通过--quick选项逐行输出模式
  • mysql.exe可以识别的命令结束分隔符:";"、\g、\G
  • ctrl+c可以取消当前的查询语句 或者 退出!
  • {source|.\}可以执行脚本文件

 

命令

牛X的帮助命令:{ help | \h | ?}  可以获得几乎你想要的任何东西,就是更加简洁直接的参考手册,(应该是基于index的技术构造的)

 

?

(\?)

Synonym for `help'.

clear

(\c)

Clear command.

connect

(\r)

Reconnect to the server. Optional arguments are db and host.

delimiter

(\d)

Set statement delimiter.

ego

(\G)

Send command to mysql server, display result vertically.

exit

(\q)

Exit mysql. Same as quit.

go

(\g)

Send command to mysql server.

help

(\h)

Display this help.

notee

(\t)

Don't write into outfile.

print

(\p)

Print current command.

prompt

(\R)

Change your mysql prompt.

quit

(\q)

Quit mysql.

rehash

(\#)

Rebuild completion hash.

source

(\.)

Execute an SQL script file. Takes a file name as an argument.

status

(\s)

Get status information from the server.

tee

(\T)

Set outfile [to_outfile]. Append everything into given outfile.

use

(\u)

Use another database. Takes database name as argument.

charset

(\C)

Switch to another charset. Might be needed for processing binlog with multi-byte charsets.

warnings

(\W)

Show warnings after every statement.

nowarning

(\w)

Don't show warnings after every statement.

 

选项

FormatConfig FileDescriptionIntroductionDeprecatedRemoved
--auto-rehashauto-rehashEnable automatic rehashing   
--batchbatchDon't use history file   
--character-sets-dir=namecharacter-sets-dirSet the default character set   
--column-namescolumn-namesWrite column names in results   
--column-type-infocolumn-type-infoDisplay result set metadata5.1.14  
--commentscommentsWhether to retain or strip comments in statements sent to the server5.1.23  
--compresscompressCompress all information sent between the client and the server   
--connect_timeout=valueconnect_timeoutThe number of seconds before connection timeout   
--database=dbnamedatabaseThe database to use   
--debug[=debug_options]debugWrite a debugging log   
--debug-checkdebug-checkPrint debugging information when the program exits5.1.21  
--debug-infodebug-infoPrint debugging information, memory and CPU statistics when the program exits   
--default-character-set=charset_namedefault-character-setUse charset_name as the default character set   
--delimiter=strdelimiterSet the statement delimiter   
--execute=statementexecuteExecute the statement and quit   
--forceforceContinue even if an SQL error occurs   
--help Display help message and exit   
--host=host_namehostConnect to the MySQL server on the given host   
--htmlhtmlProduce HTML output   
--ignore-spacesignore-spacesIgnore spaces after function names   
--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_packetThe maximum packet length to send to or receive from the 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_lengthThe buffer size for TCP/IP and socket communication   
--no-auto-rehash Disable automatic rehashing   
--no-beepno-beepDo not beep when errors occur   
--no-named-commandsno-named-commandsDisable named mysql commands   
--no-pagerno-pagerDeprecated form of --skip-pager   
--no-teeno-teeDo not copy output to a file   
--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]passwordThe password to use when connecting to the server   
--port=port_numportThe TCP/IP port number to use for the connection   
--prompt=format_strpromptSet the prompt to the specified format   
--protocol=typeprotocolThe connection 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   
--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   
--ssl-ca=file_namessl-caThe path to a file that contains a list of trusted SSL CAs   
--ssl-capath=directory_namessl-capathThe path to a directory that contains trusted SSL CA certificates in PEM format   
--ssl-cert=file_namessl-certThe name of the SSL certificate file to use for establishing a secure connection   
--ssl-cipher=cipher_listssl-cipherA list of allowable ciphers to use for SSL encryption   
--ssl-key=file_namessl-keyThe name of the SSL key file to use for establishing a secure connection   
--ssl-verify-server-certssl-verify-server-certThe server's Common Name value in its certificate is verified against the host name used when connecting to the server   
--tabletableDisplay output in tabular format   
--tee=file_nameteeAppend a copy of output to the given file   
--unbufferedunbufferedFlush the buffer after each query   
--user=user_nameuserThe MySQL user name to use when connecting to the 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   

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值