Windows-Commands-prompt

1. prompt
	1.1 设置cmd提示符
	1.2 prompt /?
2. 绕道修改cmd的初始目录
	2.1 建立计划任务
	2.2 建立快捷方式
	2.3 运行
	2.4 其他简单但不完善的方式
3. 计划任务命令帮助
	3.1 schtasks /?
	3.2 schtasks /run /?
4. 查看环境变量命令

1. prompt

更改 Cmd.exe 命令提示符,可以显示所需的任何文本,例如当前目录、时间、日期或Windows 版本号。 
如果未使用参数,此命令会将命令提示符重置为默认设置,即当前盘符及目录,后跟大于号(>)。 

1.1 设置cmd提示符

目录加时间,最后回车换行
prompt $P$S$T$G$_
C:\Windows\System32 19:56:00.85>
在命令行里运行 prompt 命令的效果仅在当前窗口有效。要持续生效需要修改环境变量。
设置 → 系统 → 系统信息 → 高级系统设置 → 高级 → 环境变量 → 用户变量 → 新建
变量: prompt
值: $P$S$T$G$_
修改后,重新打开cmd即可看到更改生效了。
查看环境变量的prompt值已被修改。
set |find "PROMPT"
PROMPT=$P$S$T$G$_

1.2 prompt /?

更改 cmd.exe 命令提示符。
PROMPT [text]
  text    指定要包含在命令提示符中的文本和信息。
提示符可以由普通字符及下列特殊代码组成:
  $A    & (与号) Ampersand
  $B    | (坚线) 管道符号
  $Q     = (等号)
  $H    Backspace (删除前一个字符)
  $V    Windows 版本号
  $N    当前驱动器
  $P    当前驱动器及路径
  $C    ( (左括号)
  $F    ) (右括号)
  $L    < (小于号)
  $G    > (大于号)
  $D    当前日期
  $T    当前时间
  $S      (空格)
  $_    回车换行符 ENTER-LINEFEED
  $$    $ (美元符号)
  $E    ANSI 转义码(ASCII 码 27)
如果命令扩展被启用,PROMPT 命令会支持下列格式化字符:
  $+    根据 PUSHD 目录堆栈的深度,零个或零个以上加号(+)字符,一个推的层一个字符。
  $M    如果当前驱动器不是网络驱动器,显示跟当前驱动器号或空字符串有关联的远程名。

2. 绕道修改cmd的初始目录

通过计划任务,可以实现运行cmd时的自定义路径,普通用户及管理员运行均有效。方法有些曲折... 
先建立一个计划任务,再建立一个快捷方式,只要通过这个快捷方式打开cmd即可。

2.1 建立计划任务

右键开始菜单,选择计算机管理(cmd: compmgmt)
计算机管理中,依次点开: 系统工具\任务计划程序\任务计划执行库
菜单栏: 操作\ 创建任务
创建任务界面\ 常规 页签
填写名称,比如: RunCMD
□使用最高权限运行若勾选可以避免弹出UAC警告,按需勾选。
创建任务界面\ 操作 页签
点击 [新建]
新建操作界面\程序或脚本: C:\Windows\System32\cmd.exe
起始于(可选): D:\Tom\Documents
最后点击 [确定]
计划任务建好,可以右键计划任务名称,选择运行看看。
打开的cmd的起始目录为D:\Tom\Documents。

2.2 建立快捷方式

桌面空白处 右键菜单 选择 新建\快捷方式
快捷方式的位置填写: schtasks.exe /run /tn "RunCMD" 
点击 下一步 填写快捷方式名称,比如: cmdT 最后点击 [完成]

2.3 运行

  • 然后双击创建的快捷方式打开cmd,起始目录为D:\Tom\Documents。
  • 右键选择以管理员身份运行cmd,起始目录也为D:\Tom\Documents。

2.4 其他简单但不完善的方式

以下是网上找到的多个不完善的版本。
管理员无效的快捷方式
cmd快捷方式,右键属性,修改起始位置即可。
但是仅正常打开有效。若使用管理员身份运行,起始位置又会回到原始状态。
未起作用的方法2
compmgmt 打开 [计算机管理] , 依次展开: 系统工具\本地用户和组\用户
找到需要修改的登录用户名,打开[用户]的属性页面。
选中 [配置文件] 页签,下方的主文件夹区域,本地路径里输入需要的路径,比如(D:\Tom)
受限的注册表法
计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
新建值: autorun; 修改数据: cd /d C:\
这个办法没去尝试,目测仅限C盘... 

3. 计划任务命令帮助

3.1 schtasks /?

SCHTASKS /parameter [arguments]
描述: 允许管理员创建、删除、查询、更改、运行和中止本地或远程系统上的计划任务。
参数列表:
    /Create         创建新计划任务。
    /Delete         删除计划任务。
    /Query          显示所有计划任务。
    /Change         更改计划任务属性。
    /Run            按需运行计划任务。
    /End            中止当前正在运行的计划任务。
    /ShowSid        显示与计划的任务名称相应的安全标识符。
    /?              显示此帮助消息。
Examples:
    SCHTASKS
    SCHTASKS /?
    SCHTASKS /Run /?
    SCHTASKS /End /?
    SCHTASKS /Create /?
    SCHTASKS /Delete /?
    SCHTASKS /Query  /?
    SCHTASKS /Change /?
    SCHTASKS /ShowSid /?

3.2 schtasks /run /?

SCHTASKS /Run [/S system [/U username [/P [password]]]] [/I] /TN taskname [/HRESULT] [/?]
描述: 按需运行计划任务。
参数列表:
    /S     system        指定要连接到的远程系统。
    /U     username      指定应在其中执行 schtasks.exe 的用户上下文。
    /P     [password]    为给定的用户上下文指定密码,如果省略则提示输入。
    /I                   忽略任何限制立即运行任务。
    /TN    taskname      指定要立即运行的任务的路径\名称。
    /HRESULT             为获得更出色的故障诊断能力,处理退出代码将采用 HRESULT 格式。
    /?                   显示此帮助消息。
示例:
    SCHTASKS /Run /?
    SCHTASKS /Run /TN "\备份\启动备份"
    SCHTASKS /Run /S system /U user /P password /I /TN "\备份\备份和还原"

4. 查看环境变量命令

  • 命令行(CMD)中:
    • set
    • msinfo32
  • PowerShell中:
    • ls env:
    • gci env:
    • dir env:
    • Get-ChildItem Env:
about_Environment_Provider
PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned 执行策略更改 执行策略可帮助你防止执行不信任的脚本。更改执行策略可能 会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略? [Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S)[?] 帮助 (默认值为“N”): Y PS C:\WINDOWS\system32> jenv -v 无法加载文件 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1 。未对文件 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1 进行数字签名。无法在当前系统上运行该脚本。有关运行脚本 和设置执行策略的详细信息,请参阅 https:/go.microsoft.co m/fwlink/?LinkID=135170 中的 about_Execution_Policies。 + CategoryInfo : SecurityError: (:) [],Pa rentContainsErrorRecordException + FullyQualifiedErrorId : UnauthorizedAccess PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser 执行策略更改 执行策略可帮助你防止执行不信任的脚本。更改执行策略可能 会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略? [Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S)[?] 帮助 (默认值为“N”): Y PS C:\WINDOWS\system32> Unblock-File -Path "E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1" PS C:\WINDOWS\system32> PS C:\WINDOWS\system32> jenv -v 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\util.psm1 ”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\util.psm1。未对文件 E:\Jenv\JEnv-for-Windows-ma in\src\util.psm1 进行数字签名。无法在当前系统上运行该脚 本。有关运行脚本和设置执行策略的详细信息,请参阅 https: /go.microsoft.com/fwlink/?LinkID=135170 中的 about_Exec ution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:40 字符: 1 + Import-Module $PSScriptRoot\util.psm1 # Provides the Open-Prompt fun ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-list .psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-list.psm1。未对文件 E:\Jenv\JEnv-for-Windo ws-main\src\jenv-list.psm1 进行数字签名。无法在当前系统 上运行该脚本。有关运行脚本和设置执行策略的详细信息,请 参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:41 字符: 1 + Import-Module $PSScriptRoot\jenv-list.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-add. psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-add.psm1。未对文件 E:\Jenv\JEnv-for-Window s-main\src\jenv-add.psm1 进行数字签名。无法在当前系统上 运行该脚本。有关运行脚本和设置执行策略的详细信息,请参 阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 a bout_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:42 字符: 1 + Import-Module $PSScriptRoot\jenv-add.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-remo ve.psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-remove.psm1。未对文件 E:\Jenv\JEnv-for-Win dows-main\src\jenv-remove.psm1 进行数字签名。无法在当前 系统上运行该脚本。有关运行脚本和设置执行策略的详细信息 ,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:43 字符: 1 + Import-Module $PSScriptRoot\jenv-remove.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-chan ge.psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-change.psm1。未对文件 E:\Jenv\JEnv-for-Win dows-main\src\jenv-change.psm1 进行数字签名。无法在当前 系统上运行该脚本。有关运行脚本和设置执行策略的详细信息 ,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:44 字符: 1 + Import-Module $PSScriptRoot\jenv-change.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-use. psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-use.psm1。未对文件 E:\Jenv\JEnv-for-Window s-main\src\jenv-use.psm1 进行数字签名。无法在当前系统上 运行该脚本。有关运行脚本和设置执行策略的详细信息,请参 阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 a bout_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:45 字符: 1 + Import-Module $PSScriptRoot\jenv-use.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-loca l.psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-local.psm1。未对文件 E:\Jenv\JEnv-for-Wind ows-main\src\jenv-local.psm1 进行数字签名。无法在当前系 统上运行该脚本。有关运行脚本和设置执行策略的详细信息, 请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中 的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:46 字符: 1 + Import-Module $PSScriptRoot\jenv-local.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-getj ava.psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-getjava.psm1。未对文件 E:\Jenv\JEnv-for-Wi ndows-main\src\jenv-getjava.psm1 进行数字签名。无法在当 前系统上运行该脚本。有关运行脚本和设置执行策略的详细信 息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=13517 0 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:47 字符: 1 + Import-Module $PSScriptRoot\jenv-getjava.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-link .psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-link.psm1。未对文件 E:\Jenv\JEnv-for-Windo ws-main\src\jenv-link.psm1 进行数字签名。无法在当前系统 上运行该脚本。有关运行脚本和设置执行策略的详细信息,请 参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:48 字符: 1 + Import-Module $PSScriptRoot\jenv-link.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-unin stall.psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-uninstall.psm1。未对文件 E:\Jenv\JEnv-for- Windows-main\src\jenv-uninstall.psm1 进行数字签名。无法 在当前系统上运行该脚本。有关运行脚本和设置执行策略的详 细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=1 35170 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:49 字符: 1 + Import-Module $PSScriptRoot\jenv-uninstall.psm1 -Forc e + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand 详细信息: 正在从路径“E:\Jenv\JEnv-for-Windows-main\src\jenv-auto scan.psm1”加载模块。 Import-Module : 无法加载文件 E:\Jenv\JEnv-for-Windows-m ain\src\jenv-autoscan.psm1。未对文件 E:\Jenv\JEnv-for-W indows-main\src\jenv-autoscan.psm1 进行数字签名。无法在 当前系统上运行该脚本。有关运行脚本和设置执行策略的详细 信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135 170 中的 about_Execution_Policies。 所在位置 E:\Jenv\JEnv-for-Windows-main\src\jenv.ps1:50 字符: 1 + Import-Module $PSScriptRoot\jenv-autoscan.psm1 -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [Impo rt-Module],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess,Micro soft.PowerShell.Commands.ImportModuleCommand PS C:\WINDOWS\system32>
08-27
mysql Ver 14.14 Distrib 5.7.18, for Win64 (x86_64) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Usage: mysql [OPTIONS] [database] -?, --help Display this help and exit. -I, --help Synonym for -? --auto-rehash Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash. (Defaults to on; use --skip-auto-rehash to disable.) -A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. --auto-vertical-output Automatically switch to vertical output mode if the result is wider than the terminal width. -B, --batch Don't use history file. Disable interactive behavior. (Enables --silent.) --bind-address=name IP address to bind to. --character-sets-dir=name Directory for character set files. --column-type-info Display column type information. -c, --comments Preserve comments. Send comments to the server. The default is --skip-comments (discard comments), enable with --comments. -C, --compress Use compression in server/client protocol. -#, --debug[=#] This is a non-debug version. Catch this and exit. --debug-check This is a non-debug version. Catch this and exit. -T, --debug-info This is a non-debug version. Catch this and exit. -D, --database=name Database to use. --default-character-set=name Set the default character set. --delimiter=name Delimiter to be used. --enable-cleartext-plugin Enable/disable the clear text authentication plugin. -e, --execute=name Execute command and quit. (Disables --force and history file.) -E, --vertical Print the output of a query (rows) vertically. -f, --force Continue even if we get an SQL error. --histignore=name A colon-separated list of patterns to keep statements from getting logged into syslog and mysql history. -G, --named-commands Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default. -i, --ignore-spaces Ignore space after function names. --init-command=name SQL Command to execute when connecting to MySQL server. Will automatically be re-executed when reconnecting. --local-infile Enable/disable LOAD DATA LOCAL INFILE. -b, --no-beep Turn off beep on error. -h, --host=name Connect to host. -H, --html Produce HTML output. -X, --xml Produce XML output. --line-numbers Write line numbers for errors. (Defaults to on; use --skip-line-numbers to disable.) -L, --skip-line-numbers Don't write line number for errors. -n, --unbuffered Flush buffer after each query. --column-names Write column names in results. (Defaults to on; use --skip-column-names to disable.) -N, --skip-column-names Don't write column names in results. --sigint-ignore Ignore SIGINT (CTRL-C). -o, --one-database Ignore statements except those that occur while the default database is the one named at the command line. -p, --password[=name] Password to use when connecting to server. If password is not given it's asked from the tty. -W, --pipe Use named pipes to connect to server. -P, --port=# Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306). --prompt=name Set the mysql prompt to this value. --protocol=name The protocol to use for connection (tcp, socket, pipe, memory). -q, --quick Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file. -r, --raw Write fields without conversion. Used with --batch. --reconnect Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default. (Defaults to on; use --skip-reconnect to disable.) -s, --silent Be more silent. Print results with a tab as separator, each row on new line. --shared-memory-base-name=name Base name of shared memory. -S, --socket=name The socket file to use for connection. --ssl-mode=name SSL connection mode. --ssl Deprecated. Use --ssl-mode instead. (Defaults to on; use --skip-ssl to disable.) --ssl-verify-server-cert Deprecated. Use --ssl-mode=VERIFY_IDENTITY instead. --ssl-ca=name CA file in PEM format. --ssl-capath=name CA directory. --ssl-cert=name X509 cert in PEM format. --ssl-cipher=name SSL cipher to use. --ssl-key=name X509 key in PEM format. --ssl-crl=name Certificate revocation list. --ssl-crlpath=name Certificate revocation list path. --tls-version=name TLS version to use, permitted values are: TLSv1, TLSv1.1 -t, --table Output in table format. --tee=name Append everything into outfile. See interactive help (\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default. -u, --user=name User for login if not current user. -U, --safe-updates Only allow UPDATE and DELETE that uses keys. -U, --i-am-a-dummy Synonym for option --safe-updates, -U. -v, --verbose Write more. (-v -v -v gives the table output format). -V, --version Output version information and exit. -w, --wait Wait and retry if connection is down. --connect-timeout=# Number of seconds before connection timeout. --max-allowed-packet=# The maximum packet length to send to or receive from server. --net-buffer-length=# The buffer size for TCP/IP and socket communication. --select-limit=# Automatic limit for SELECT when using --safe-updates. --max-join-size=# Automatic limit for rows in a join when using --safe-updates. --secure-auth Refuse client connecting to server if it uses old (pre-4.1.1) protocol. Deprecated. Always TRUE --server-arg=name Send embedded server this as a parameter. --show-warnings Show warnings after every statement. -j, --syslog Log filtered interactive commands to syslog. Filtering of commands depends on the patterns supplied via histignore option besides the default patterns. --plugin-dir=name Directory for client-side plugins. --default-auth=name Default authentication client-side plugin to use. --binary-mode By default, ASCII '\0' is disallowed and '\r\n' is translated to '\n'. This switch turns off both features, and also turns off parsing of all clientcommands except \C and DELIMITER, in non-interactive mode (for input piped to mysql or loaded using the 'source' command). This is necessary when processing output from mysqlbinlog that may contain blobs. --connect-expired-password Notify the server that this client is prepared to handle expired password sandbox mode. Default options are read from the following files in the given order: C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf D:\mysql\mysql-5.7.18-winx64\mysql-5.7.18-winx64\my.ini D:\mysql\mysql-5.7.18-winx64\mysql-5.7.18-winx64\my.cnf The following groups are read: mysql client The following options may be given as the first argument: --print-defaults Print the program argument list and exit. --no-defaults Don't read default options from any option file, except for login file. --defaults-file=# Only read default options from the given file #. --defaults-extra-file=# Read this file after the global files are read. --defaults-group-suffix=# Also read groups with concat(group, suffix) --login-path=# Read this path from the login file. Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- ---------------------------------------- auto-rehash TRUE auto-vertical-output FALSE bind-address (No default value) character-sets-dir (No default value) column-type-info FALSE comments FALSE compress FALSE database (No default value) default-character-set utf8 delimiter ; enable-cleartext-plugin FALSE vertical FALSE force FALSE histignore (No default value) named-commands FALSE ignore-spaces FALSE init-command (No default value) local-infile FALSE no-beep FALSE host (No default value) html FALSE xml FALSE line-numbers TRUE unbuffered FALSE column-names TRUE sigint-ignore FALSE port 3306 prompt mysql> quick FALSE raw FALSE reconnect TRUE shared-memory-base-name (No default value) socket (No default value) ssl TRUE ssl-verify-server-cert FALSE ssl-ca (No default value) ssl-capath (No default value) ssl-cert (No default value) ssl-cipher (No default value) ssl-key (No default value) ssl-crl (No default value) ssl-crlpath (No default value) tls-version (No default value) table FALSE user (No default value) safe-updates FALSE i-am-a-dummy FALSE connect-timeout 0 max-allowed-packet 16777216 net-buffer-length 16384 select-limit 1000 max-join-size 1000000 secure-auth TRUE show-warnings FALSE plugin-dir (No default value) default-auth (No default value) binary-mode FALSE connect-expired-password FALSE C:\Users\lenovo>mysql –u root –p mysql Ver 14.14 Distrib 5.7.18, for Win64 (x86_64) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Usage: mysql [OPTIONS] [database] -?, --help Display this help and exit. -I, --help Synonym for -? --auto-rehash Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash. (Defaults to on; use --skip-auto-rehash to disable.) -A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. --auto-vertical-output Automatically switch to vertical output mode if the result is wider than the terminal width. -B, --batch Don't use history file. Disable interactive behavior. (Enables --silent.) --bind-address=name IP address to bind to. --character-sets-dir=name Directory for character set files. --column-type-info Display column type information. -c, --comments Preserve comments. Send comments to the server. The default is --skip-comments (discard comments), enable with --comments. -C, --compress Use compression in server/client protocol. -#, --debug[=#] This is a non-debug version. Catch this and exit. --debug-check This is a non-debug version. Catch this and exit. -T, --debug-info This is a non-debug version. Catch this and exit. -D, --database=name Database to use. --default-character-set=name Set the default character set. --delimiter=name Delimiter to be used. --enable-cleartext-plugin Enable/disable the clear text authentication plugin. -e, --execute=name Execute command and quit. (Disables --force and history file.) -E, --vertical Print the output of a query (rows) vertically. -f, --force Continue even if we get an SQL error. --histignore=name A colon-separated list of patterns to keep statements from getting logged into syslog and mysql history. -G, --named-commands Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default. -i, --ignore-spaces Ignore space after function names. --init-command=name SQL Command to execute when connecting to MySQL server. Will automatically be re-executed when reconnecting. --local-infile Enable/disable LOAD DATA LOCAL INFILE. -b, --no-beep Turn off beep on error. -h, --host=name Connect to host. -H, --html Produce HTML output. -X, --xml Produce XML output. --line-numbers Write line numbers for errors. (Defaults to on; use --skip-line-numbers to disable.) -L, --skip-line-numbers Don't write line number for errors. -n, --unbuffered Flush buffer after each query. --column-names Write column names in results. (Defaults to on; use --skip-column-names to disable.) -N, --skip-column-names Don't write column names in results. --sigint-ignore Ignore SIGINT (CTRL-C). -o, --one-database Ignore statements except those that occur while the default database is the one named at the command line. -p, --password[=name] Password to use when connecting to server. If password is not given it's asked from the tty. -W, --pipe Use named pipes to connect to server. -P, --port=# Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306). --prompt=name Set the mysql prompt to this value. --protocol=name The protocol to use for connection (tcp, socket, pipe, memory). -q, --quick Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file. -r, --raw Write fields without conversion. Used with --batch. --reconnect Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default. (Defaults to on; use --skip-reconnect to disable.) -s, --silent Be more silent. Print results with a tab as separator, each row on new line. --shared-memory-base-name=name Base name of shared memory. -S, --socket=name The socket file to use for connection. --ssl-mode=name SSL connection mode. --ssl Deprecated. Use --ssl-mode instead. (Defaults to on; use --skip-ssl to disable.) --ssl-verify-server-cert Deprecated. Use --ssl-mode=VERIFY_IDENTITY instead. --ssl-ca=name CA file in PEM format. --ssl-capath=name CA directory. --ssl-cert=name X509 cert in PEM format. --ssl-cipher=name SSL cipher to use. --ssl-key=name X509 key in PEM format. --ssl-crl=name Certificate revocation list. --ssl-crlpath=name Certificate revocation list path. --tls-version=name TLS version to use, permitted values are: TLSv1, TLSv1.1 -t, --table Output in table format. --tee=name Append everything into outfile. See interactive help (\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default. -u, --user=name User for login if not current user. -U, --safe-updates Only allow UPDATE and DELETE that uses keys. -U, --i-am-a-dummy Synonym for option --safe-updates, -U. -v, --verbose Write more. (-v -v -v gives the table output format). -V, --version Output version information and exit. -w, --wait Wait and retry if connection is down. --connect-timeout=# Number of seconds before connection timeout. --max-allowed-packet=# The maximum packet length to send to or receive from server. --net-buffer-length=# The buffer size for TCP/IP and socket communication. --select-limit=# Automatic limit for SELECT when using --safe-updates. --max-join-size=# Automatic limit for rows in a join when using --safe-updates. --secure-auth Refuse client connecting to server if it uses old (pre-4.1.1) protocol. Deprecated. Always TRUE --server-arg=name Send embedded server this as a parameter. --show-warnings Show warnings after every statement. -j, --syslog Log filtered interactive commands to syslog. Filtering of commands depends on the patterns supplied via histignore option besides the default patterns. --plugin-dir=name Directory for client-side plugins. --default-auth=name Default authentication client-side plugin to use. --binary-mode By default, ASCII '\0' is disallowed and '\r\n' is translated to '\n'. This switch turns off both features, and also turns off parsing of all clientcommands except \C and DELIMITER, in non-interactive mode (for input piped to mysql or loaded using the 'source' command). This is necessary when processing output from mysqlbinlog that may contain blobs. --connect-expired-password Notify the server that this client is prepared to handle expired password sandbox mode. Default options are read from the following files in the given order: C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf D:\mysql\mysql-5.7.18-winx64\mysql-5.7.18-winx64\my.ini D:\mysql\mysql-5.7.18-winx64\mysql-5.7.18-winx64\my.cnf The following groups are read: mysql client The following options may be given as the first argument: --print-defaults Print the program argument list and exit. --no-defaults Don't read default options from any option file, except for login file. --defaults-file=# Only read default options from the given file #. --defaults-extra-file=# Read this file after the global files are read. --defaults-group-suffix=# Also read groups with concat(group, suffix) --login-path=# Read this path from the login file. Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- ---------------------------------------- auto-rehash TRUE auto-vertical-output FALSE bind-address (No default value) character-sets-dir (No default value) column-type-info FALSE comments FALSE compress FALSE database (No default value) default-character-set utf8 delimiter ; enable-cleartext-plugin FALSE vertical FALSE force FALSE histignore (No default value) named-commands FALSE ignore-spaces FALSE init-command (No default value) local-infile FALSE no-beep FALSE host (No default value) html FALSE xml FALSE line-numbers TRUE unbuffered FALSE column-names TRUE sigint-ignore FALSE port 3306 prompt mysql> quick FALSE raw FALSE reconnect TRUE shared-memory-base-name (No default value) socket (No default value) ssl TRUE ssl-verify-server-cert FALSE ssl-ca (No default value) ssl-capath (No default value) ssl-cert (No default value) ssl-cipher (No default value) ssl-key (No default value) ssl-crl (No default value) ssl-crlpath (No default value) tls-version (No default value) table FALSE user (No default value) safe-updates FALSE i-am-a-dummy FALSE connect-timeout 0 max-allowed-packet 16777216 net-buffer-length 16384 select-limit 1000 max-join-size 1000000 secure-auth TRUE show-warnings FALSE plugin-dir (No default value) default-auth (No default value) binary-mode FALSE connect-expired-password FALSE C:\Users\lenovo>
06-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值