小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

MySQL8.0中的關(guān)鍵字與保留字

 vnxy001 2024-02-19 發(fā)布于浙江

在使用MySQL時,有時不小心會將MySQL的關(guān)鍵字設(shè)置為表的字段,在進行數(shù)據(jù)插入的時候總是提示SQL有問題。如果將MySQL中的關(guān)鍵字與保留字設(shè)置為表字段時,解決方法為給關(guān)鍵字加上反引號 " `" 。

注意是 反引號 **反引號 ** 反引號 輸入法切換到英文狀態(tài)下,鍵盤上Esc鍵下面,數(shù)字鍵1左邊,Tab鍵上面那個鍵。

當(dāng)然最好還是在建表的時候盡量避免關(guān)鍵字,因本人使用的是MySQL8,以下為MySQL8中的關(guān)鍵字與保留字。

官網(wǎng)地址:https://dev./doc/refman/8.0/en/keywords.html

MySQL 8.0中的關(guān)鍵字和保留詞,以及各個詞在版本之間的更改。保留的關(guān)鍵字標有(R)。另外,_FILENAME是保留的

ACCESSIBLE ?ACCOUNTACTION
ACTIVE; added in 8.0.14 (nonreserved)ADD ?ADMIN; became nonreserved in 8.0.12
AFTERAGAINSTAGGREGATE
ALGORITHMALL ?ALTER ?
ALWAYSANALYSE; removed in 8.0.1ANALYZE ?
AND ?ANYARRAY; added in 8.0.17 (reserved); became nonreserved in 8.0.19
AS ?ASC ?ASCII
ASENSITIVE ?ATATTRIBUTE; added in 8.0.21 (nonreserved)
AUTOEXTEND_SIZEAUTO_INCREMENTAVG
AVG_ROW_LENGTHBACKUPBEFORE ?
BEGINBETWEEN ?BIGINT ?
BINARY ?BINLOGBIT
BLOB ?BLOCKBOOL
BOOLEANBOTH ?BTREE
BUCKETS; added in 8.0.2 (nonreserved)BY ?BYTE
CACHECALL ?CASCADE ?
CASCADEDCASE ?CATALOG_NAME
CHAINCHANGE ?CHANGED
CHANNELCHAR ?CHARACTER ?
CHARSETCHECK ?CHECKSUM
CIPHERCLASS_ORIGINCLIENT
CLONE; added in 8.0.3 (nonreserved)CLOSECOALESCE
CODECOLLATE ?COLLATION
COLUMN ?COLUMNSCOLUMN_FORMAT
COLUMN_NAMECOMMENTCOMMIT
COMMITTEDCOMPACTCOMPLETION
COMPONENTCOMPRESSEDCOMPRESSION
CONCURRENTCONDITION ?CONNECTION
CONSISTENTCONSTRAINT ?CONSTRAINT_CATALOG
CONSTRAINT_NAMECONSTRAINT_SCHEMACONTAINS
CONTEXTCONTINUE ?CONVERT ?
CPUCREATE ?CROSS ?
CUBE ?; became reserved in 8.0.1CUME_DIST ?; added in 8.0.2 (reserved)CURRENT
CURRENT_DATE ?CURRENT_TIME ?CURRENT_TIMESTAMP ?
CURRENT_USER ?CURSOR ?CURSOR_NAME
DATADATABASE ?DATABASES ?
DATAFILEDATEDATETIME
DAYDAY_HOUR ?DAY_MICROSECOND ?
DAY_MINUTE ?DAY_SECOND ?DEALLOCATE
DEC ?DECIMAL ?DECLARE ?
DEFAULT ?DEFAULT_AUTHDEFINER
DEFINITION; added in 8.0.4 (nonreserved)DELAYED ?DELAY_KEY_WRITE
DELETE ?DENSE_RANK ?; added in 8.0.2 (reserved)DESC ?
DESCRIBE ?DESCRIPTION; added in 8.0.4 (nonreserved)DES_KEY_FILE; removed in 8.0.3
DETERMINISTIC ?DIAGNOSTICSDIRECTORY
DISABLEDISCARDDISK
DISTINCT ?DISTINCTROW ?DIV ?
DODOUBLE ?DROP ?
DUAL ?DUMPFILEDUPLICATE
DYNAMICEACH ?ELSE ?
ELSEIF ?EMPTY ?; added in 8.0.4 (reserved)ENABLE
ENCLOSED ?ENCRYPTIONEND
ENDSENFORCED; added in 8.0.16 (nonreserved)ENGINE
ENGINESENGINE_ATTRIBUTE; added in 8.0.21 (nonreserved)ENUM
ERRORERRORSESCAPE
ESCAPED ?EVENTEVENTS
EVERYEXCEPT ?EXCHANGE
EXCLUDE; added in 8.0.2 (nonreserved)EXECUTEEXISTS ?
EXIT ?EXPANSIONEXPIRE
EXPLAIN ?EXPORTEXTENDED
EXTENT_SIZEFAILED_LOGIN_ATTEMPTS; added in 8.0.19 (nonreserved)FALSE ?
FASTFAULTSFETCH ?
FIELDSFILEFILE_BLOCK_SIZE
FILTERFIRSTFIRST_VALUE ?; added in 8.0.2 (reserved)
FIXEDFLOAT ?FLOAT4 ?
FLOAT8 ?FLUSHFOLLOWING; added in 8.0.2 (nonreserved)
FOLLOWSFOR ?FORCE ?
FOREIGN ?FORMATFOUND
FROM ?FULLFULLTEXT ?
FUNCTION ?; became reserved in 8.0.1GENERALGENERATED ?
GEOMCOLLECTION; added in 8.0.11 (nonreserved)GEOMETRYGEOMETRYCOLLECTION
GET ?GET_FORMATGET_MASTER_PUBLIC_KEY; added in 8.0.4 (reserved); became nonreserved in 8.0.11
GLOBALGRANT ?GRANTS
GROUP ?GROUPING ?; added in 8.0.1 (reserved)GROUPS ?; added in 8.0.2 (reserved)
GROUP_REPLICATIONHANDLERHASH
HAVING ?HELPHIGH_PRIORITY ?
HISTOGRAM; added in 8.0.2 (nonreserved)HISTORY; added in 8.0.3 (nonreserved)HOST
HOSTSHOURHOUR_MICROSECOND ?
HOUR_MINUTE ?HOUR_SECOND ?IDENTIFIED
IF ?IGNORE ?IGNORE_SERVER_IDS
IMPORTIN ?INACTIVE; added in 8.0.14 (nonreserved)
INDEX ?INDEXESINFILE ?
INITIAL_SIZEINNER ?INOUT ?
INSENSITIVE ?INSERT ?INSERT_METHOD
INSTALLINSTANCEINT ?
INT1 ?INT2 ?INT3 ?
INT4 ?INT8 ?INTEGER ?
INTERVAL ?INTO ?INVISIBLE
INVOKERIOIO_AFTER_GTIDS ?
IO_BEFORE_GTIDS ?IO_THREADIPC
IS ?ISOLATIONISSUER
ITERATE ?JOIN ?JSON
JSON_TABLE ?; added in 8.0.4 (reserved)JSON_VALUE; added in 8.0.21 (nonreserved)KEY ?
KEYS ?KEY_BLOCK_SIZEKILL ?
LAG ?; added in 8.0.2 (reserved)LANGUAGELAST
LAST_VALUE ?; added in 8.0.2 (reserved)LATERAL ?; added in 8.0.14 (reserved)LEAD ?; added in 8.0.2 (reserved)
LEADING ?LEAVE ?LEAVES
LEFT ?LESSLEVEL
LIKE ?LIMIT ?LINEAR ?
LINES ?LINESTRINGLIST
LOAD ?LOCALLOCALTIME ?
LOCALTIMESTAMP ?LOCK ?LOCKED; added in 8.0.1 (nonreserved)
LOCKSLOGFILELOGS
LONG ?LONGBLOB ?LONGTEXT ?
LOOP ?LOW_PRIORITY ?MMANAGED; added in 8.0.22 (nonreserved)MASTER
MASTER_AUTO_POSITIONMASTER_BIND ?MASTER_COMPRESSION_ALGORITHMS; added in 8.0.18 (nonreserved)
MASTER_CONNECT_RETRYMASTER_DELAYMASTER_HEARTBEAT_PERIOD
MASTER_HOSTMASTER_LOG_FILEMASTER_LOG_POS
MASTER_PASSWORDMASTER_PORTMASTER_PUBLIC_KEY_PATH; added in 8.0.4 (nonreserved)
MASTER_RETRY_COUNTMASTER_SERVER_IDMASTER_SSL
MASTER_SSL_CAMASTER_SSL_CAPATHMASTER_SSL_CERT
MASTER_SSL_CIPHERMASTER_SSL_CRLMASTER_SSL_CRLPATH
MASTER_SSL_KEYMASTER_SSL_VERIFY_SERVER_CERT ?MASTER_TLS_CIPHERSUITES; added in 8.0.19 (nonreserved)
MASTER_TLS_VERSIONMASTER_USERMASTER_ZSTD_COMPRESSION_LEVEL; added in 8.0.18 (nonreserved)
MATCH ?MAXVALUE ?MAX_CONNECTIONS_PER_HOUR
MAX_QUERIES_PER_HOURMAX_ROWSMAX_SIZE
MAX_UPDATES_PER_HOURMAX_USER_CONNECTIONSMEDIUM
MEDIUMBLOB ?MEDIUMINT ?MEDIUMTEXT ?
MEMBER; added in 8.0.17 (reserved); became nonreserved in 8.0.19MEMORYMERGE
MESSAGE_TEXTMICROSECONDMIDDLEINT ?
MIGRATEMINUTEMINUTE_MICROSECOND ?
MINUTE_SECOND ?MIN_ROWSMOD ?
MODEMODIFIES ?MODIFY
MONTHMULTILINESTRINGMULTIPOINT
MULTIPOLYGONMUTEXMYSQL_ERRNONNAME
NAMESNATIONALNATURAL ?
NCHARNDBNDBCLUSTER
NESTED; added in 8.0.4 (nonreserved)NETWORK_NAMESPACE; added in 8.0.16 (nonreserved)NEVER
NEWNEXTNO
NODEGROUPNONENOT ?
NOWAIT; added in 8.0.1 (nonreserved)NO_WAITNO_WRITE_TO_BINLOG ?
NTH_VALUE ?; added in 8.0.2 (reserved)NTILE ?; added in 8.0.2 (reserved)NULL ?
NULLS; added in 8.0.2 (nonreserved)NUMBERNUMERIC ?
NVARCHAROOF ?; added in 8.0.1 (reserved)OFF; added in 8.0.20 (nonreserved)OFFSET
OJ; added in 8.0.16 (nonreserved)OLD; added in 8.0.14 (nonreserved)ON ?
ONEONLYOPEN
OPTIMIZE ?OPTIMIZER_COSTS ?OPTION ?
OPTIONAL; added in 8.0.13 (nonreserved)OPTIONALLY ?OPTIONS
OR ?ORDER ?ORDINALITY; added in 8.0.4 (nonreserved)
ORGANIZATION; added in 8.0.4 (nonreserved)OTHERS; added in 8.0.2 (nonreserved)OUT ?
OUTER ?OUTFILE ?OVER ?; added in 8.0.2 (reserved)
OWNERPPACK_KEYSPAGEPARSER
PARTIALPARTITION ?PARTITIONING
PARTITIONSPASSWORDPASSWORD_LOCK_TIME; added in 8.0.19 (nonreserved)
PATH; added in 8.0.4 (nonreserved)PERCENT_RANK ?; added in 8.0.2 (reserved)PERSIST; became nonreserved in 8.0.16
PERSIST_ONLY; added in 8.0.2 (reserved); became nonreserved in 8.0.16PHASEPLUGIN
PLUGINSPLUGIN_DIRPOINT
POLYGONPORTPRECEDES
PRECEDING; added in 8.0.2 (nonreserved)PRECISION ?PREPARE
PRESERVEPREVPRIMARY ?
PRIVILEGESPRIVILEGE_CHECKS_USER; added in 8.0.18 (nonreserved)PROCEDURE ?
PROCESS; added in 8.0.11 (nonreserved)PROCESSLISTPROFILE
PROFILESPROXYPURGE ?QQUARTER
QUERYQUICKRRANDOM; added in 8.0.18 (nonreserved)RANGE ?
RANK ?; added in 8.0.2 (reserved)READ ?READS ?
READ_ONLYREAD_WRITE ?REAL ?
REBUILDRECOVERRECURSIVE ?; added in 8.0.1 (reserved)
REDOFILE; removed in 8.0.3REDO_BUFFER_SIZEREDUNDANT
REFERENCE; added in 8.0.4 (nonreserved)REFERENCES ?REGEXP ?
RELAYRELAYLOGRELAY_LOG_FILE
RELAY_LOG_POSRELAY_THREADRELEASE ?
RELOADREMOTE; added in 8.0.3 (nonreserved); removed in 8.0.14REMOVE
RENAME ?REORGANIZEREPAIR
REPEAT ?REPEATABLEREPLACE ?
REPLICATE_DO_DBREPLICATE_DO_TABLEREPLICATE_IGNORE_DB
REPLICATE_IGNORE_TABLEREPLICATE_REWRITE_DBREPLICATE_WILD_DO_TABLE
REPLICATE_WILD_IGNORE_TABLEREPLICATIONREQUIRE ?
REQUIRE_ROW_FORMAT; added in 8.0.19 (nonreserved)RESETRESIGNAL ?
RESOURCE; added in 8.0.3 (nonreserved)RESPECT; added in 8.0.2 (nonreserved)RESTART; added in 8.0.4 (nonreserved)
RESTORERESTRICT ?RESUME
RETAIN; added in 8.0.14 (nonreserved)RETURN ?RETURNED_SQLSTATE
RETURNING; added in 8.0.21 (nonreserved)RETURNSREUSE; added in 8.0.3 (nonreserved)
REVERSEREVOKE ?RIGHT ?
RLIKE ?ROLE; became nonreserved in 8.0.1ROLLBACK
ROLLUPROTATEROUTINE
ROW ?; became reserved in 8.0.2ROWS ?; became reserved in 8.0.2ROW_COUNT
ROW_FORMATROW_NUMBER ?; added in 8.0.2 (reserved)RTREE
SAVEPOINTSCHEDULESCHEMA ?
SCHEMAS ?SCHEMA_NAMESECOND
SECONDARY; added in 8.0.16 (nonreserved)SECONDARY_ENGINE; added in 8.0.13 (nonreserved)SECONDARY_ENGINE_ATTRIBUTE; added in 8.0.21 (nonreserved)
SECONDARY_LOAD; added in 8.0.13 (nonreserved)SECONDARY_UNLOAD; added in 8.0.13 (nonreserved)SECOND_MICROSECOND ?
SECURITYSELECT ?SENSITIVE ?
SEPARATOR ?SERIALSERIALIZABLE
SERVERSESSIONSET ?
SHARESHOW ?SHUTDOWN
SIGNAL ?SIGNEDSIMPLE
SKIP; added in 8.0.1 (nonreserved)SLAVESLOW
SMALLINT ?SNAPSHOTSOCKET
SOMESONAMESOUNDS
SOURCESPATIAL ?SPECIFIC ?
SQL ?SQLEXCEPTION ?SQLSTATE ?
SQLWARNING ?SQL_AFTER_GTIDSSQL_AFTER_MTS_GAPS
SQL_BEFORE_GTIDSSQL_BIG_RESULT ?SQL_BUFFER_RESULT
SQL_CACHE; removed in 8.0.3SQL_CALC_FOUND_ROWS ?SQL_NO_CACHE
SQL_SMALL_RESULT ?SQL_THREADSQL_TSI_DAY
SQL_TSI_HOURSQL_TSI_MINUTESQL_TSI_MONTH
SQL_TSI_QUARTERSQL_TSI_SECONDSQL_TSI_WEEK
SQL_TSI_YEARSRID; added in 8.0.3 (nonreserved)SSL ?
STACKEDSTARTSTARTING ?
STARTSSTATS_AUTO_RECALCSTATS_PERSISTENT
STATS_SAMPLE_PAGESSTATUSSTOP
STORAGESTORED ?STRAIGHT_JOIN ?
STREAM; added in 8.0.20 (nonreserved)STRINGSUBCLASS_ORIGIN
SUBJECTSUBPARTITIONSUBPARTITIONS
SUPERSUSPENDSWAPS
SWITCHESSYSTEM ?; added in 8.0.3 (reserved)TABLE ?
TABLESTABLESPACETABLE_CHECKSUM
TABLE_NAMETEMPORARYTEMPTABLE
TERMINATED ?TEXTTHAN
THEN ?THREAD_PRIORITY; added in 8.0.3 (nonreserved)TIES; added in 8.0.2 (nonreserved)
TIMETIMESTAMPTIMESTAMPADD
TIMESTAMPDIFFTINYBLOB ?TINYINT ?
TINYTEXT ?TLS; added in 8.0.21 (nonreserved)TO ?
TRAILING ?TRANSACTIONTRIGGER ?
TRIGGERSTRUE ?TRUNCATE
TYPETYPESUNBOUNDED; added in 8.0.2 (nonreserved)
UNCOMMITTEDUNDEFINEDUNDO ?
UNDOFILEUNDO_BUFFER_SIZEUNICODE
UNINSTALLUNION ?UNIQUE ?
UNKNOWNUNLOCK ?UNSIGNED ?
UNTILUPDATE ?UPGRADE
USAGE ?USE ?USER
USER_RESOURCESUSE_FRMUSING ?
UTC_DATE ?UTC_TIME ?UTC_TIMESTAMP ?
VALIDATIONVALUEVALUES ?
VARBINARY ?VARCHAR ?VARCHARACTER ?
VARIABLESVARYING ?VCPU; added in 8.0.3 (nonreserved)
VIEWVIRTUAL ?VISIBLE
WAITWARNINGSWEEK
WEIGHT_STRINGWHEN ?WHERE ?
WHILE ?WINDOW ? added in 8.0.2 (reserved)WITH ?
WITHOUTWORKWRAPPER
WRITE ?X509XA
XIDXMLXOR ?
YEARYEAR_MONTH ?ZEROFILL ?

與MySQL5.7相比MySQL8中添加的關(guān)鍵字和保留字,保留的關(guān)鍵字標有?

ACTIVEADMINARRAY
ATTRIBUTEBUCKETSCLONE
COMPONENTCUME_DIST ?DEFINITION
DENSE_RANK ?DESCRIPTIONEMPTY ?
ENFORCEDENGINE_ATTRIBUTEEXCEPT ?
EXCLUDEFAILED_LOGIN_ATTEMPTSFIRST_VALUE ?
FOLLOWINGGEOMCOLLECTIONGET_MASTER_PUBLIC_KEY
GROUPING ?GROUPS ?HISTOGRAM
HISTORYINACTIVEINVISIBLE
JSON_TABLE ?JSON_VALUELAG ?
LAST_VALUE ?LATERAL ?LEAD ?
LOCKEDMANAGEDMASTER_COMPRESSION_ALGORITHMS
MASTER_PUBLIC_KEY_PATHMASTER_TLS_CIPHERSUITESMASTER_ZSTD_COMPRESSION_LEVEL
MEMBERNESTEDNETWORK_NAMESPACE
NOWAITNTH_VALUE ?NTILE ?
NULLSOF ?OFF
OJOLDOPTIONAL
ORDINALITYORGANIZATIONOTHERS
OVER ?PASSWORD_LOCK_TIMEPATH
PERCENT_RANK ?PERSISTPERSIST_ONLY
PRECEDINGPRIVILEGE_CHECKS_USERPROCESS
RANDOMRANK ?RECURSIVE ?
REFERENCEREQUIRE_ROW_FORMATRESOURCE
RESPECTRESTARTRETAIN
RETURNINGREUSEROLE
ROW_NUMBER ?SECONDARYSECONDARY_ENGINE
SECONDARY_ENGINE_ATTRIBUTESECONDARY_LOADSECONDARY_UNLOAD
SKIPSRIDSTREAM
SYSTEM ?THREAD_PRIORITYTIES
TLSUNBOUNDEDVCPU
VISIBLEWINDOW ?

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多