mysql的help怎么操作,mysql help命令

mysql 怎么用 help contents

1. 函數(shù)遞歸操作,以前沒怎么使用Shell進(jìn)行函數(shù)的遞歸操作。

站在用戶的角度思考問題,與客戶深入溝通,找到沙洋網(wǎng)站設(shè)計與沙洋網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:成都做網(wǎng)站、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、國際域名空間、網(wǎng)頁空間、企業(yè)郵箱。業(yè)務(wù)覆蓋沙洋地區(qū)。

2. 借鑒tree的輸出格式,對結(jié)果進(jìn)行格式化輸出。

思路如下:首先定義一個number為0,每次進(jìn)入一次recursive函數(shù),都會把當(dāng)前的number加1,如果只是這樣的話,那number值將一直增長了,所以在上述腳本else調(diào)用recursive函數(shù)部分,會在其后執(zhí)行number=$[$number-1],類似于恢復(fù)到上一層目錄下。

如何使用My Sql

一、Mysql數(shù)據(jù)庫服務(wù)器登錄

登錄mysql需要切換到dos下的mysql的bin目錄,進(jìn)行如下操作:

語法格式:mysql -h host_name -u user_name -p password (本機(jī)的話-h 和host_name可?。?/p>

----------------------我------------割--------------------------

My Experience:

C:\program files\mysql\mysql server 4.1\binmysql -u root -p

Enter password:******

先輸入用戶名和密碼登陸要求(加上-p),回車后等出現(xiàn)"Enter password:",再輸入密碼回車,這樣就可以

成功登陸mysql,否則將會登陸失敗。

----------------------我------------割--------------------------

登陸成功后會顯示如下信息:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1 to server version: 4.1.10-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql

標(biāo)識"mysql",當(dāng)你看到這個出現(xiàn)在窗口的最左邊的頂格時,這就是告訴你,你可以輸入命令進(jìn)行操作了。

mysql \s 查看版本信息

mysql \q or mysql quit 退出mysql數(shù)據(jù)庫服務(wù)器

mysql \h or mysql help 查看幫助(其他的數(shù)據(jù)庫服務(wù)器相關(guān)命令)

想要詳細(xì)答案,加我QQ52539778

如何獲取mysql幫助信息

獲取mysql有關(guān)的幫助信息,直接在mysql提示符下輸入help即可獲得有關(guān)在mysql客戶端相關(guān)的幫助信息。

這個方式與Oracle SQL*plus下的help 是類似的。

mysql help

For information about MySQL products and services, visit:

For developer information, including the MySQL Reference Manual, visit:

To buy MySQL Enterprise support, training, or other products, visit:

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下也有這樣一個connect命令

delimiter (\d) Set statement delimiter. --設(shè)置命令終止符,缺省為;,比如我們可以設(shè)定為/來表示語句結(jié)束

edit (\e) Edit command with $EDITOR. --編輯緩沖區(qū)的上一條SQL語句到文件,缺省調(diào)用vi,文件會放在/tmp路徑下

ego (\G) Send command to mysql server, display result vertically. --控制結(jié)果顯示為垂直顯示

exit (\q) Exit mysql. Same as quit. --退出mysql

go (\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. --自動補(bǔ)齊相關(guān)對象名字

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ò)號內(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 names

You can turn off this feature to get a quicker startup with -A

Connection id: 5

Current database: chardb

--設(shè)置分頁,在多余一個頁面顯示時會不停的翻滾,用該命令可以設(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; --該查詢會超出一屏顯示后按空格鍵會自動翻滾到下一屏

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下的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; --關(guān)閉輸出到文件,相當(dāng)于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 '

--恢復(fù)到缺省提示符

SessionA prompt;

Returning to default PROMPT of mysql

--執(zhí)行sql腳本文件

mysql system more query.sql --注意,此時為當(dāng)前目錄

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)

--獲取狀態(tài)信息

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數(shù)據(jù)庫怎么建索引?

MySQL數(shù)據(jù)庫建立索引步驟:

1、使用SQLPlus或者PLSQL登錄MySQL數(shù)據(jù)庫。

2、執(zhí)行語句create

index

indexname

on

table(col)

tablespace

tablespacename;其中

"indexname"為需要建立索引的索引名;

"table"是需要建立索引的表;

"col"為需要建立索引的字段列;

”tablespacename“為建立索引存放的空間(如果不需要制定表空間則使用“create

index

indexname

on

table(col)”)。

調(diào)用mysql程序問題

1.mysqlshow?這個命令是用來獲取數(shù)據(jù)庫信息的。

2.mysqlshow?--help?是顯示這個命令的詳細(xì)解釋,參數(shù)列表和參數(shù)說明。任何命令一般都有?--help,當(dāng)你想不起這個命令的用法的時候,寫上--help就知道啦,當(dāng)然是英文的說明,準(zhǔn)備好金山詞霸...

3.shell確實是命令提示符,不過是linux的。

4.你在windows?cmd?中不能使用mysqlshow?的話,應(yīng)該是環(huán)境變量沒設(shè)置吧,不過一般mysql安裝版都是自動設(shè)的。你可以試試寫全路徑。

如果你想知道環(huán)境變量有沒有%MYSQL_HOME%/bin,可以在cmd?中打?set?path命令查看。

以上。

當(dāng)前文章:mysql的help怎么操作,mysql help命令
標(biāo)題來源:http://muchs.cn/article10/phehdo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、商城網(wǎng)站云服務(wù)器、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站策劃域名注冊

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作