>  기사  >  데이터 베이스  >  MySQL 클라이언트 명령

MySQL 클라이언트 명령

WBOY
WBOY앞으로
2023-09-07 21:13:051181검색

MySQL 客户端命令

일부 MySQL 클라이언트 명령을 이해해 봅시다 -

MySQL은 사용자가 실행한 모든 SQL 문을 실행을 위해 서버로 보냅니다. mysql이 스스로 해석하는 명령 세트도 있습니다.

명령 목록 가져오기

프롬프트에서 아래에 언급된 명령을 입력하여 이러한 명령 목록을 찾을 수 있습니다 -

mysql> help

Output

List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit      (\e) Edit command with $EDITOR.
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.
nopager   () Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
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.
system    (\!) Execute a system shell command.
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.

mysql이 "--binary-mode" 옵션으로 호출되면 입력 Piped를 mysql에 전달하거나 source 명령을 사용하여 로드하는 것으로 가정하면 비대화형 모드에서 문자 세트 및 구분 기호를 제외한 모든 mysql 명령이 비활성화됩니다.

모든 명령에는 긴 형식과 짧은 형식이 있습니다.

긴 형식 명령

긴 형식은 대소문자를 구분하고 짧은 형식은 대소문자를 구분합니다. 긴 형식 뒤에는 선택적 세미콜론 종결자가 올 수 있지만 짧은 형식 뒤에는 아무 것도 와서는 안 됩니다.

짧은 형식 명령

여러 명령에 짧은 형식 명령을 사용하세요. -line /* ... */ 주석은 지원되지 않습니다. 속기 명령은 /*! 한 줄 내에서 작동합니다. ... */ 버전 주석, /*+ ... */ 최적화 프로그램 힌트 주석에도 동일하게 적용됩니다. 이는 객체 정의에 저장됩니다.

위 내용은 MySQL 클라이언트 명령의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제