這篇文章主要講解了“MySQL內(nèi)置help解析”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“MySQL內(nèi)置help解析”吧!
創(chuàng)新互聯(lián)建站主營儀隴網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,重慶APP開發(fā)公司,儀隴h5小程序定制開發(fā)搭建,儀隴網(wǎng)站營銷推廣歡迎儀隴等地區(qū)企業(yè)咨詢
1,登錄MySQL,詢問系統(tǒng)內(nèi)置說明書
root@db02 scripts]# mysql -uroot -S /data/3306/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.36 Source distribution 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. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ? contents ##我們不知道怎么用,就問系統(tǒng),你都有什么內(nèi)容,下面就是它反饋給你的內(nèi)容 Account Management ##賬戶管理 Administration ###管理 Compound Statements ##復(fù)合語句 Data Definition ##數(shù)據(jù)定義 Data Manipulation ##數(shù)據(jù)操作 Data Types ##數(shù)據(jù)類型 Functions ##功能 Functions and Modifiers for Use with GROUP BY ##與組一起使用的函數(shù)和修飾符 Geographic Features ##地理特征 Help Metadata ##幫助元數(shù)據(jù) Language Structure ##語言結(jié)構(gòu) Plugins ##插件 Procedures ##程序 Storage Engines ##存儲引擎 Table Maintenance ##表維護(hù) Transactions ##交易 User-Defined Functions ##用戶定義的函數(shù) Utility ##效用
2,我們按照它給的說明書,進(jìn)行下面的詢問
1)例如:我們想新建1個數(shù)據(jù)庫,怎么找到語法呢?
mysql> ? Data Definition #查看了上面的說明書,應(yīng)該在數(shù)據(jù)如何定義這里面,所以?問號它; You asked for help about help category: "Data Definition" For more information, type 'help- ', where
- is one of the following topics: CREATE DATABASE CREATE EVENT CREATE FUNCTION CREATE INDEX CREATE LOGFILE GROUP CREATE PROCEDURE CREATE SERVER CREATE TABLE CREATE TABLESPACE CREATE TRIGGER .....若干省略選項(xiàng)
2)通過上面 就找到了 CREATE DATABASE 選項(xiàng),但我還是不會建立數(shù)據(jù)庫啊,那繼續(xù)問吧
mysql> ? CREATE DATABASE Name: 'CREATE DATABASE' Description: Syntax: CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name #這次就找到新建數(shù)據(jù)庫的語法了,直接創(chuàng)建即可 [create_specification] ... ##需要注意{}大括號多選1,[]可選可忽略,其它必選 create_specification: [DEFAULT] CHARACTER SET [=] charset_name | [DEFAULT] COLLATE [=] collation_name CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE. URL: http://dev.mysql.com/doc/refman/5.6/en/create-database.html
3)下面就是根據(jù)系統(tǒng)提示的語法,新建一個qiuyuetao的數(shù)據(jù)庫
mysql> create database qiuyuetao; Query OK, 1 row affected (0.05 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | qiuyuetao | | test | +--------------------+ 5 rows in set (0.07 sec)
3,SQL語句分為3類
1)DDL :數(shù)據(jù)定義的語言,可?Data Definition去查詢
create、alter、drop,管理基礎(chǔ)數(shù)據(jù):例如 庫,表
2)DCL:Data control Language-數(shù)據(jù)控制語言
grant、revoke、commit,rollback,用戶授權(quán),權(quán)限回收,數(shù)據(jù)提交回滾
3)DML:Date Manipulation Language-數(shù)據(jù)操作語言
select、update、delete、insert,對表與記錄 做操作
感謝各位的閱讀,以上就是“MySQL內(nèi)置help解析”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對MySQL內(nèi)置help解析這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!