国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

Mysql help命令(幫助信息)中文注解

2024-07-24 12:46:47
字體:
供稿:網(wǎng)友

在開發(fā)或測(cè)試環(huán)境在碰到mysql相關(guān)故障時(shí),大多數(shù)朋友可能會(huì)通過論壇發(fā)帖,QQ群討論方式來獲取幫助。該方式是獲取幫助的有效途徑之一。然而如果在生產(chǎn)環(huán)境,在沒有網(wǎng)絡(luò)的環(huán)境下,這些方式就無助于問題的解決。無論何種數(shù)據(jù)庫,從官方網(wǎng)站獲取幫助是最直接最有效的方式。其次沒有網(wǎng)絡(luò)的環(huán)境下,我們可以通過MySQL客戶端工具自帶的幫助信息來解決問題。

1)MySQL官方手冊(cè)

和Oracle官方文檔一下,MySQL官方手冊(cè)是獲取MySQL幫助最直接最效的方式。該手冊(cè)包含很多個(gè)部分,比如有關(guān)SQL的語法,MySQL安裝方式,MySQL的系統(tǒng)變量,狀態(tài)變量,命令行的常用工具,數(shù)據(jù)庫的管等等。總之是一個(gè)MySQL數(shù)據(jù)相關(guān)的大合集。支持PDF及html方式下載。

下載位置:http://dev.mysql.com/doc/

2)MySQL客戶端工具自帶的幫助

獲取mysql有關(guān)的幫助信息,直接在mysql提示符下輸入help即可獲得有關(guān)在mysql客戶端相關(guān)的幫助信息。這個(gè)方式與Oracle SQL*plus下的help 是類似的。mysql> helpFor information about MySQL products and services, visit: http://www.mysql.com/For developer information, including the MySQL Reference Manual, visit: http://dev.mysql.com/To buy MySQL Enterprise support, training, or other products, visit: https://shop.mysql.com/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. --清除當(dāng)前輸入的語句connect (/r) Reconnect to the server. Optional arguments are db and host. --重新連接,通常用于被剔除或異常斷開后重新連接,SQL*plus下也有這樣一個(gè)connect命令delimiter (/d) Set statement delimiter. --設(shè)置命令終止符,缺省為;,比如我們可以設(shè)定為/來表示語句結(jié)束 edit (/e) Edit command with $EDITOR. --編輯緩沖區(qū)的上一條SQL語句到文件,缺省調(diào)用vi,文件會(huì)放在/tmp路徑下ego (/G) Send command to mysql server, display result vertically. --控制結(jié)果顯示為垂直顯示exit (/q) Exit mysql. Same as quit. --退出mysqlgo (/g) Send command to mysql server. --發(fā)送命令到mysql服務(wù)help (/h) Display this help.nopager (/n) Disable pager, print to stdout. --關(guān)閉頁設(shè)置,打印到標(biāo)準(zhǔn)輸出 notee (/t) Don't write into outfile. --關(guān)閉輸出到文件pager (/P) Set PAGER [to_pager]. Print the query results via PAGER. --設(shè)置pager方式,可以設(shè)置為調(diào)用more,less等等,主要是用于分頁顯示print (/p) Print current command. prompt (/R) Change your mysql prompt. --改變mysql的提示符 quit (/q) Quit mysql. rehash (/#) Rebuild completion hash. --自動(dòng)補(bǔ)齊相關(guān)對(duì)象名字 source (/.) Execute an SQL script file. Takes a file name as an argument. --執(zhí)行腳本文件status (/s) Get status information from the server. --獲得狀態(tài)信息system (/!) Execute a system shell command. --執(zhí)行系統(tǒng)命令 tee (/T) Set outfile [to_outfile]. Append everything into given outfile.--操作結(jié)果輸出到文件 use (/u) Use another database. Takes database name as argument. --切換數(shù)據(jù)庫charset (/C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. --設(shè)置字符集warnings (/W) Show warnings after every statement. --打印警告信息nowarning (/w) Don't show warnings after every statement.--上面的所有命令,擴(kuò)號(hào)內(nèi)的為快捷操作,即只需要輸入“/”+ 字母即可執(zhí)行For server side help, type 'help contents' --注意這里的描述help contents將獲得服務(wù)器端的相關(guān)幫助信息--演示部分,演示常用命令--connect命令mysql> connect chardb localhost;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AConnection id: 5Current database: chardb--設(shè)置分頁,在多余一個(gè)頁面顯示時(shí)會(huì)不停的翻滾,用該命令可以設(shè)置分頁,設(shè)置為調(diào)用系統(tǒng)命令mysql> pager more --設(shè)置為more方式PAGER set to 'more'mysql> select table_name,table_type,engine from information_schema.tables; --該查詢會(huì)超出一屏顯示后按空格鍵會(huì)自動(dòng)翻滾到下一屏mysql> pager tail -5; --設(shè)置輸出尾部5行PAGER set to 'tail -5'mysql> select table_name,table_type,engine from information_schema.tables;| setup_timers | BASE TABLE | PERFORMANCE_SCHEMA || threads | BASE TABLE | PERFORMANCE_SCHEMA || animals | BASE TABLE | InnoDB || shop | BASE TABLE | InnoDB |+----------------------------------------------+-------------+--------------------+92 rows in set (0.02 sec)mysql> pager; --查看當(dāng)前的pager設(shè)置PAGER set to 'tail -5'mysql> nopager; --切換到標(biāo)準(zhǔn)(缺省)pager方式PAGER set to stdout--tee命令,輸出日志文件mysql> tee /tmp/query.log --開啟輸出到文件,相當(dāng)與SQL*plus下的spoolLogging to file '/tmp/query.log'mysql> select table_name,table_type,engine from information_schema.tables;+----------------------------------------------+-------------+--------------------+| table_name | table_type | engine |+----------------------------------------------+-------------+--------------------+| CHARACTER_SETS | SYSTEM VIEW | MEMORY || COLLATIONS | SYSTEM VIEW | MEMORY | .............mysql> notee; --關(guān)閉輸出到文件,相當(dāng)于SQL*Plus下的spool offOutfile disabled.mysql> system tail /tmp/query.log --查看輸出的日志文件| setup_consumers | BASE TABLE | PERFORMANCE_SCHEMA || setup_instruments | BASE TABLE | PERFORMANCE_SCHEMA || setup_timers | BASE TABLE | PERFORMANCE_SCHEMA || threads | BASE TABLE | PERFORMANCE_SCHEMA || animals | BASE TABLE | InnoDB || shop | BASE TABLE | InnoDB |+----------------------------------------------+-------------+--------------------+92 rows in set (0.02 sec) --改變mysql提示符mysql> prompt SessionA> PROMPT set to 'SessionA> '--恢復(fù)到缺省提示符SessionA> prompt;Returning to default PROMPT of mysql> --執(zhí)行sql腳本文件mysql> system more query.sql --注意,此時(shí)為當(dāng)前目錄use chardbselect * from tb_isam;mysql> source query.sqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changed+------+-------+| id | value |+------+-------+| 1 | a || 2 | b || 3 | c || 4 | f |+------+-------+4 rows in set (0.00 sec)--獲取狀態(tài)信息mysql> status;--------------mysql Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1Connection id: 6Current database: chardbCurrent user: root@localhostSSL: Not in useCurrent pager: lessUsing outfile: ''Using delimiter: ;Server version: 5.5.37-log MySQL Community Server (GPL)Protocol version: 10Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: utf8Client characterset: latin1Conn. characterset: latin1UNIX socket: /var/lib/mysql/mysql.sockUptime: 3 hours 10 min 59 secThreads: 1 Questions: 97 Slow queries: 0 Opens: 313 Flush tables: 1 Open tables: 51 Queries per second avg: 0.008----------------修改客戶端字符集mysql> charset gbk;Charset changedmysql> /s--------------mysql Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1Connection id: 6Current database: chardbCurrent user: root@localhostSSL: Not in useCurrent pager: lessUsing outfile: ''Using delimiter: ;Server version: 5.5.37-log MySQL Community Server (GPL)Protocol version: 10Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: utf8Client characterset: gbk ---客戶端和conn端字符集都變成gbk了。Conn. characterset: gbkUNIX socket: /var/lib/mysql/mysql.sockUptime: 3 hours 13 min 33 secThreads: 1 Questions: 105 Slow queries: 0 Opens: 313 Flush tables: 1 Open tables: 51 Queries per second avg: 0.009--------------mysql> warnings;Show warnings enabled.mysql> selecs 1;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'selecs 1' at line 1mysql> show warnings;+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+| Level | Code | Message |+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+| Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'selecs 1' at line 1 |+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)mysql> show errors;+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+| Level | Code | Message |+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+| Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'selecs 1' at line 1 |+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)mysql> nowarning;Show warnings disabled.
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 定兴县| 甘南县| 岳普湖县| 子洲县| 广饶县| 平潭县| 淳化县| 监利县| 信丰县| 临潭县| 辰溪县| 吴桥县| 大英县| 固始县| 宜都市| 达日县| 广水市| 长武县| 三穗县| 长治县| 井冈山市| 福建省| 普宁市| 平安县| 城固县| 旺苍县| 钟山县| 襄樊市| 北宁市| 扎鲁特旗| 义马市| 手游| 梁河县| 双辽市| 汕尾市| 察哈| 河池市| 遂宁市| 仁寿县| 弋阳县| 桂平市|