<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        如何獲取mysql幫助信息_MySQL

        來源:懂視網 責編:小采 時間:2020-11-09 19:43:04
        文檔

        如何獲取mysql幫助信息_MySQL

        如何獲取mysql幫助信息_MySQL:在開發或測試環境在碰到mysql相關故障時,大多數朋友可能會通過論壇發帖,QQ群討論方式來獲取幫助。該方式是獲取幫助的有效途徑之一。然而如果在生產環境,在沒有網絡的環境下,這些方式就無助于問題的解決。無論何種數據庫,從官方網站獲取幫助是最直接最有
        推薦度:
        導讀如何獲取mysql幫助信息_MySQL:在開發或測試環境在碰到mysql相關故障時,大多數朋友可能會通過論壇發帖,QQ群討論方式來獲取幫助。該方式是獲取幫助的有效途徑之一。然而如果在生產環境,在沒有網絡的環境下,這些方式就無助于問題的解決。無論何種數據庫,從官方網站獲取幫助是最直接最有

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

        1)MySQL官方手冊

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

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

        獲取mysql有關的幫助信息,直接在mysql提示符下輸入help即可獲得有關在mysql客戶端相關的幫助信息。
        這個方式與Oracle SQL*plus下的help 是類似的。
        mysql> help
        
        For 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. --清除當前輸入的語句
        connect (\r) Reconnect to the server. Optional arguments are db and host. --重新連接,通常用于被剔除或異常斷開后重新連接,SQL*plus下也有這樣一個connect命令
        delimiter (\d) Set statement delimiter. --設置命令終止符,缺省為;,比如我們可以設定為/來表示語句結束 
        edit (\e) Edit command with $EDITOR. --編輯緩沖區的上一條SQL語句到文件,缺省調用vi,文件會放在/tmp路徑下
        ego (\G) Send command to mysql server, display result vertically. --控制結果顯示為垂直顯示
        exit (\q) Exit mysql. Same as quit. --退出mysql
        go (\g) Send command to mysql server. --發送命令到mysql服務
        help (\h) Display this help.
        nopager (\n) Disable pager, print to stdout. --關閉頁設置,打印到標準
        輸出 notee (\t) Don't write into outfile. --關閉輸出到文件 pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. --設置pager方式,可以設置為調用more,less等等,主要是用于分頁顯示 print (\p) Print current command. prompt (\R) Change your mysql prompt. --改變mysql的提示符 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. --打印警告信息 nowarning (\w) Don't show warnings after every statement. --上面的所有命令,擴號內的為快捷操作,即只需要輸入“\”+ 字母即可執行 For server side help, type 'help contents' --注意這里的描述help contents將獲得服務器端的相關幫助信息 --演示部分,演示常用命令 --connect命令 mysql> connect chardb localhost; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Connection id: 5 Current database: chardb --設置分頁,在多余一個頁面顯示時會不停的翻滾,用該命令可以設置分頁,設置為調用系統命令 mysql> pager more --設置為more方式 PAGER set to 'more' mysql> select table_name,table_type,engine from information_schema.tables; --該查詢會超出一屏顯示后按空格鍵會自動翻滾到下一屏 mysql> pager tail -5; --設置輸出尾部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; --查看當前的pager設置 PAGER set to 'tail -5' mysql> nopager; --切換到標準(缺省)pager方式 PAGER set to stdout --tee命令,輸出日志文件 mysql> tee /tmp/query.log --開啟輸出到文件,相當與SQL*plus下的spool Logging 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; --關閉輸出到文件,相當于SQL*Plus下的spool off Outfile 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> ' --恢復到缺省提示符 SessionA> prompt; Returning to default PROMPT of mysql> --執行sql腳本文件 mysql> system more query.sql --注意,此時為當前目錄 use chardb select * from tb_isam; mysql> source query.sql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed +------+-------+ | id | value | +------+-------+ | 1 | a | | 2 | b | | 3 | c | | 4 | f | +------+-------+ 4 rows in set (0.00 sec) --獲取狀態信息 mysql> status; -------------- mysql Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1 Connection id: 6 Current database: chardb Current user: root@localhost SSL: Not in use Current pager: less Using outfile: '' Using delimiter: ; Server version: 5.5.37-log MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: utf8 Client characterset: latin1 Conn. characterset: latin1 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 3 hours 10 min 59 sec Threads: 1 Questions: 97 Slow queries: 0 Opens: 313 Flush tables: 1 Open tables: 51 Queries per second avg: 0.008 -------------- --修改客戶端字符集 mysql> charset gbk; Charset changed mysql> \s -------------- mysql Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1 Connection id: 6 Current database: chardb Current user: root@localhost SSL: Not in use Current pager: less Using outfile: '' Using delimiter: ; Server version: 5.5.37-log MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: utf8 Client characterset: gbk ---客戶端和conn端字符集都變成gbk了。 Conn. characterset: gbk UNIX socket: /var/lib/mysql/mysql.sock Uptime: 3 hours 13 min 33 sec Threads: 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 1 mysql> 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.
        --獲取服務器管理相關的幫助,輸入help contents
        mysql> help contents;
        You asked for help about help category: "Contents"
        For more information, type 'help ', where  is one of the following
        categories:
         Account Management
         Administration
         Compound Statements
         Data Definition
         Data Manipulation
         Data Types
         Functions
         Functions and Modifiers for Use with GROUP BY
         Geographic Features
         Help Metadata
         Language Structure
         Plugins
         Procedures
         Storage Engines
         Table Maintenance
         Transactions
         User-Defined Functions
         Utility
        
        --要查詢那一個部分的內容,直接輸入help + 內容,如下
        mysql> help administration;
        You asked for help about help category: "Administration"
        For more information, type 'help ', where  is one of the following
        topics:
         BINLOG
         CACHE INDEX
         FLUSH
         FLUSH QUERY CACHE
         HELP COMMAND
         KILL
         ..........
        
        --接下來,我們查看administration部分下的flush命令用法,直接輸入help flush;即可
        mysql> help flush;
        Name: 'FLUSH'
        Description:
        Syntax:
        FLUSH [NO_WRITE_TO_BINLOG | LOCAL]
         flush_option [, flush_option] ...
        
        The FLUSH statement has several variant forms that clear or reload
        various internal caches, flush tables, or acquire locks. To execute
        FLUSH, you must have the RELOAD privilege. Specific flush options might
        require additional privileges, as described later. 
        
        --查看cache index的幫助信息
        mysql> help CACHE INDEX;
        Name: 'CACHE INDEX'
        Description:
        Syntax:
        CACHE INDEX
         tbl_index_list [, tbl_index_list] ...
         [PARTITION (partition_list | ALL)]
         IN key_cache_name
        
        tbl_index_list:
         tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]
        
        partition_list:
         partition_name[, partition_name][, ...]
         ........................
        
        --總結,即通過逐級help的方式即可獲得與其主題相關的詳細信息。 --Author: Leshami --Blog: http://blog.csdn.net/leshami
        
        --比較常用的show 命令,通常查看系統變量,狀態變量等
        mysql> help show;
        Name: 'SHOW'
        Description:
        SHOW has many forms that provide information about databases, tables,
        columns, or status information about the server. This section describes
        those following:
        
        SHOW AUTHORS
        SHOW {BINARY | MASTER} LOGS
        
        --設置系統變量,用set 命令
        mysql> help set;
        Name: 'SET'
        Description:
        Syntax:
        SET variable_assignment [, variable_assignment] ...
        
        variable_assignment:
         user_var_name = expr
         | [GLOBAL | SESSION] system_var_name = expr
         | [@@global. | @@session. | @@]system_var_name = expr
        
        The SET statement assigns values to different types of variables that
        affect the operation of the server or your client. Older versions of
        MySQL employed SET OPTION, but this syntax is deprecated in favor of
        SET without OPTION.
        
        URL: http://dev.mysql.com/doc/refman/5.5/en/set-statement.html
        

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        如何獲取mysql幫助信息_MySQL

        如何獲取mysql幫助信息_MySQL:在開發或測試環境在碰到mysql相關故障時,大多數朋友可能會通過論壇發帖,QQ群討論方式來獲取幫助。該方式是獲取幫助的有效途徑之一。然而如果在生產環境,在沒有網絡的環境下,這些方式就無助于問題的解決。無論何種數據庫,從官方網站獲取幫助是最直接最有
        推薦度:
        標簽: 信息 獲取 幫助
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲人xxx日本人18| 亚洲一级特黄无码片| 亚洲国产综合专区在线电影| 一级毛片试看60分钟免费播放| 国产99视频精品免费视频7| 亚洲国产高清国产拍精品| 成年人在线免费观看| 亚洲综合激情五月色一区| 免费人成视频在线| 亚洲.国产.欧美一区二区三区| 日本高清免费不卡视频| 亚洲AV日韩AV永久无码色欲 | 精品国产免费一区二区三区| 超清首页国产亚洲丝袜| 久久久WWW免费人成精品| 国产亚洲精AA在线观看SEE| 99re这里有免费视频精品| 亚洲最新在线视频| 免费鲁丝片一级观看| 国产亚洲福利一区二区免费看| 亚洲国产精品激情在线观看| 91在线视频免费观看| 亚洲成人网在线播放| 免费观看理论片毛片| h视频在线免费观看| 久久久久亚洲AV片无码| 91九色老熟女免费资源站| 亚洲色www永久网站| 亚洲一区视频在线播放| 99爱在线精品视频免费观看9 | 亚洲一区AV无码少妇电影| 婷婷综合缴情亚洲狠狠尤物| 中文毛片无遮挡高清免费| 亚洲精品在线不卡| 四虎影视在线永久免费看黄| 99在线视频免费观看| 亚洲日本国产综合高清| 亚洲综合色区在线观看| 91免费播放人人爽人人快乐| 久久精品国产亚洲av瑜伽| 亚洲AV无码精品色午夜果冻不卡 |