伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

Mysql关键字和保留字 - 版本5.7

来源:网络转载 浏览:67次 时间:2022-11-17

Mysql关键字和保留字 - 版本5.7

1. Mysql关键字简介

    关键字是在SQL中具有重要意义的词。某些关键字,如SELECT, DELETE或 BIGINT,被保留,需要用作标识符,例如表和列名特殊待遇。对于内置函数的名称也是如此。

    非保留关键字作为标识符而不引用,保留字被允许作为标识符:// 比如mysql> CREATE TABLE interval (begin INT, end INT);
ERROR 1064 (42000): You have an error in your SQL syntax ...
near 'interval (begin INT, end INT)'    BEGIN并且END是关键字,但不保留,因此它们用作标识符不需要引用。INTERVAL是一个保留关键字,必须引用为标识符// 比如mysql> CREATE TABLE `interval` (begin INT, end INT);
Query OK, 0 rows affected (0.01 sec)

    例外:在限定名称中的句点后面的单词必须是一个标识符,所以即使被保留也不需要引用它// 比如mysql> CREATE TABLE mydb.interval (begin INT, end INT);
Query OK, 0 rows affected (0.01 sec)

    Mysql允许内置函数的名称作为标识符,但可能需要谨慎使用。例如, COUNT作为列名可以接受。但是,默认情况下,在函数名和下一个( 字符之间的函数调用中不允许有空格。该要求使解析器能够区分名称是在函数调用还是在非功能上下文中使用。

    下表想你展示了MySQL 5.7中的关键字和保留字,以及从版本到版本的单个字的更改。保留关键字标有(R)。另外,_FILENAME是保留的。

    在需要的时候,你可能会升级到更高版本,所以最好先看看未来的保留字。1234567891011121314151617181920212223242526

2. 关键字表

关键字关键字关键字ACCESSIBLE (R)ACCOUNTACTIONADD (R)AFTERAGAINSTAGGREGATEALGORITHMALL (R)ALTER (R)ALWAYSANALYSEANALYZE (R)AND (R)ANYAS (R)ASC (R)ASCIIASENSITIVE (R)ATAUTOEXTEND_SIZEAUTO_INCREMENTAVGAVG_ROW_LENGTHBACKUPBEFORE (R)BEGINBETWEEN (R)BIGINT (R)BINARY (R)BINLOGBITBLOB (R)BLOCKBOOLBOOLEANBOTH (R)BTREEBY (R)BYTECACHECALL (R)CASCADE (R)CASCADEDCASE (R)CATALOG_NAMECHAINCHANGE (R)CHANGEDCHANNEL[C]CHAR (R)CHARACTER (R)CHARSETCHECK (R)CHECKSUMCIPHERCLASS_ORIGINCLIENTCLOSECOALESCECODECOLLATE (R)COLLATIONCOLUMN (R)COLUMNSCOLUMN_FORMATCOLUMN_NAMECOMMENTCOMMITCOMMITTEDCOMPACTCOMPLETIONCOMPRESSEDCOMPRESSION并[d]CONCURRENTCONDITION (R)CONNECTIONCONSISTENTCONSTRAINT (R)CONSTRAINT_CATALOGCONSTRAINT_NAMECONSTRAINT_SCHEMACONTAINSCONTEXTCONTINUE (R)CONVERT (R)CPUCREATE (R)CROSS (R)CUBECURRENTCURRENT_DATE (R)CURRENT_TIME (R)CURRENT_TIMESTAMP (R)CURRENT_USER (R)CURSOR (R)CURSOR_NAMEDATADATABASE (R)DATABASES (R)DATAFILEDATEDATETIMEDAYDAY_HOUR (R)DAY_MICROSECOND (R)DAY_MINUTE (R)DAY_SECOND (R)DEALLOCATEDEC (R)DECIMAL (R)DECLARE (R)DEFAULT (R)DEFAULT_AUTHDEFINERDELAYED (R)DELAY_KEY_WRITEDELETE (R)DESC (R)DESCRIBE (R)DES_KEY_FILEDETERMINISTIC (R)DIAGNOSTICSDIRECTORYDISABLEDISCARDDISKDISTINCT (R)DISTINCTROW (R)DIV (R)DODOUBLE (R)DROP (R)DUAL (R)DUMPFILEDUPLICATEDYNAMICEACH (R)ELSE (R)ELSEIF (R)ENABLEENCLOSED (R)ENCRYPTION并[e]ENDENDSENGINEENGINESENUMERRORERRORSESCAPEESCAPED (R)EVENTEVENTSEVERYEXCHANGEEXECUTEEXISTS (R)EXIT (R)EXPANSIONEXPIREEXPLAIN (R)EXPORTEXTENDEDEXTENT_SIZEFALSE (R)FASTFAULTSFETCH (R)FIELDSFILEFILE_BLOCK_SIZE[F]FILTER[G]FIRSTFIXEDFLOAT (R)FLOAT4 (R)FLOAT8 (R)FLUSHFOLLOWS[H]FOR (R)FORCE (R)FOREIGN (R)FORMATFOUNDFROM (R)FULLFULLTEXT (R)FUNCTIONGENERALGENERATED[i](R)GEOMETRYGEOMETRYCOLLECTIONGET (R)GET_FORMATGLOBALGRANT (R)GRANTSGROUP (R)GROUP_REPLICATION[j]的HANDLERHASHHAVING (R)HELPHIGH_PRIORITY (R)HOSTHOSTSHOURHOUR_MICROSECOND (R)HOUR_MINUTE (R)HOUR_SECOND (R)IDENTIFIEDIF (R)IGNORE (R)IGNORE_SERVER_IDSIMPORTIN (R)INDEX (R)INDEXESINFILE (R)INITIAL_SIZEINNER (R)INOUT (R)INSENSITIVE (R)INSERT (R)INSERT_METHODINSTALLINSTANCE[K]INT (R)INT1 (R)INT2 (R)INT3 (R)INT4 (R)INT8 (R)INTEGER (R)INTERVAL (R)INTO (R)INVOKERIOIO_AFTER_GTIDS (R)IO_BEFORE_GTIDS (R)IO_THREADIPCIS (R)ISOLATIONISSUERITERATE (R)JOIN (R)JSON[1]KEY (R)KEYS (R)KEY_BLOCK_SIZEKILL (R)LANGUAGELASTLEADING (R)LEAVE (R)LEAVESLEFT (R)LESSLEVELLIKE (R)LIMIT (R)LINEAR (R)LINES (R)LINESTRINGLISTLOAD (R)LOCALLOCALTIME (R)LOCALTIMESTAMP (R)LOCK (R)LOCKSLOGFILELOGSLONG (R)LONGBLOB (R)LONGTEXT (R)LOOP (R)LOW_PRIORITY (R)MASTERMASTER_AUTO_POSITIONMASTER_BIND (R)MASTER_CONNECT_RETRYMASTER_DELAYMASTER_HEARTBEAT_PERIODMASTER_HOSTMASTER_LOG_FILEMASTER_LOG_POSMASTER_PASSWORDMASTER_PORTMASTER_RETRY_COUNTMASTER_SERVER_IDMASTER_SSLMASTER_SSL_CAMASTER_SSL_CAPATHMASTER_SSL_CERTMASTER_SSL_CIPHERMASTER_SSL_CRLMASTER_SSL_CRLPATHMASTER_SSL_KEYMASTER_SSL_VERIFY_SERVER_CERT (R)MASTER_TLS_VERSION[米]MASTER_USERMATCH (R)MAXVALUE (R)MAX_CONNECTIONS_PER_HOURMAX_QUERIES_PER_HOURMAX_ROWSMAX_SIZEMAX_STATEMENT_TIME[n]的MAX_UPDATES_PER_HOURMAX_USER_CONNECTIONSMEDIUMMEDIUMBLOB (R)MEDIUMINT (R)MEDIUMTEXT (R)MEMORYMERGEMESSAGE_TEXTMICROSECONDMIDDLEINT (R)MIGRATEMINUTEMINUTE_MICROSECOND (R)MINUTE_SECOND (R)MIN_ROWSMOD (R)MODEMODIFIES (R)MODIFYMONTHMULTILINESTRINGMULTIPOINTMULTIPOLYGONMUTEXMYSQL_ERRNONAMENAMESNATIONALNATURAL (R)NCHARNDBNDBCLUSTERNEVER[O]NEWNEXTNONODEGROUPNONBLOCKING[P]NONENOT (R)NO_WAITNO_WRITE_TO_BINLOG (R)NULL (R)NUMBERNUMERIC (R)NVARCHAROFFSETOLD_PASSWORD[Q]ON (R)ONEONLYOPENOPTIMIZE (R)OPTIMIZER_COSTS[r](R)OPTION (R)OPTIONALLY (R)OPTIONSOR (R)ORDER (R)OUT (R)OUTER (R)OUTFILE (R)OWNERPACK_KEYSPAGEPARSERPARSE_GCOL_EXPR[S]PARTIALPARTITION (R)PARTITIONINGPARTITIONSPASSWORDPHASEPLUGINPLUGINSPLUGIN_DIRPOINTPOLYGONPORTPRECEDES[T]PRECISION (R)PREPAREPRESERVEPREVPRIMARY (R)PRIVILEGESPROCEDURE (R)PROCESSLISTPROFILEPROFILESPROXYPURGE (R)QUARTERQUERYQUICKRANGE (R)READ (R)READS (R)READ_ONLYREAD_WRITE (R)REAL (R)REBUILDRECOVERREDOFILEREDO_BUFFER_SIZEREDUNDANTREFERENCES (R)REGEXP (R)RELAYRELAYLOGRELAY_LOG_FILERELAY_LOG_POSRELAY_THREADRELEASE (R)RELOADREMOVERENAME (R)REORGANIZEREPAIRREPEAT (R)REPEATABLEREPLACE (R)REPLICATE_DO_DB[U]REPLICATE_DO_TABLE[V]REPLICATE_IGNORE_DB[W]REPLICATE_IGNORE_TABLE[X]REPLICATE_REWRITE_DB[Y]REPLICATE_WILD_DO_TABLE[Z]REPLICATE_WILD_IGNORE_TABLE[AA]REPLICATIONREQUIRE (R)RESETRESIGNAL (R)RESTORERESTRICT (R)RESUMERETURN (R)RETURNED_SQLSTATERETURNSREVERSEREVOKE (R)RIGHT (R)RLIKE (R)ROLLBACKROLLUPROTATE[AB]ROUTINEROWROWSROW_COUNTROW_FORMATRTREESAVEPOINTSCHEDULESCHEMA (R)SCHEMAS (R)SCHEMA_NAMESECONDSECOND_MICROSECOND (R)SECURITYSELECT (R)SENSITIVE (R)SEPARATOR (R)SERIALSERIALIZABLESERVERSESSIONSET (R)SHARESHOW (R)SHUTDOWNSIGNAL (R)SIGNEDSIMPLESLAVESLOWSMALLINT (R)SNAPSHOTSOCKETSOMESONAMESOUNDSSOURCESPATIAL (R)SPECIFIC (R)SQL (R)SQLEXCEPTION (R)SQLSTATE (R)SQLWARNING (R)SQL_AFTER_GTIDSSQL_AFTER_MTS_GAPSSQL_BEFORE_GTIDSSQL_BIG_RESULT (R)SQL_BUFFER_RESULTSQL_CACHESQL_CALC_FOUND_ROWS (R)SQL_NO_CACHESQL_SMALL_RESULT (R)SQL_THREADSQL_TSI_DAYSQL_TSI_HOURSQL_TSI_MINUTESQL_TSI_MONTHSQL_TSI_QUARTERSQL_TSI_SECONDSQL_TSI_WEEKSQL_TSI_YEARSSL (R)STACKEDSTARTSTARTING (R)STARTSSTATS_AUTO_RECALCSTATS_PERSISTENTSTATS_SAMPLE_PAGESSTATUSSTOPSTORAGESTORED[ac](R)STRAIGHT_JOIN (R)STRINGSUBCLASS_ORIGINSUBJECTSUBPARTITIONSUBPARTITIONSSUPERSUSPENDSWAPSSWITCHESTABLE (R)TABLESTABLESPACETABLE_CHECKSUMTABLE_NAMETEMPORARYTEMPTABLETERMINATED (R)TEXTTHANTHEN (R)TIMETIMESTAMPTIMESTAMPADDTIMESTAMPDIFFTINYBLOB (R)TINYINT (R)TINYTEXT (R)TO (R)TRAILING (R)TRANSACTIONTRIGGER (R)TRIGGERSTRUE (R)TRUNCATETYPETYPESUNCOMMITTEDUNDEFINEDUNDO (R)UNDOFILEUNDO_BUFFER_SIZEUNICODEUNINSTALLUNION (R)UNIQUE (R)UNKNOWNUNLOCK (R)UNSIGNED (R)UNTILUPDATE (R)UPGRADEUSAGE (R)USE (R)USERUSER_RESOURCESUSE_FRMUSING (R)UTC_DATE (R)UTC_TIME (R)UTC_TIMESTAMP (R)VALIDATIONVALUEVALUES (R)VARBINARY (R)VARCHAR (R)VARCHARACTER (R)VARIABLESVARYING (R)VIEWVIRTUAL[ae](R)WAITWARNINGSWEEKWEIGHT_STRINGWHEN (R)WHERE (R)WHILE (R)WITH (R)WITHOUT[AF]WORKWRAPPERWRITE (R)X509XAXID[AG]XMLXOR (R)YEARYEAR_MONTH (R)ZEROFILL (R)


  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net