mysql 8 中的系统保留关键字
在mysql中建表时,一定要注意避免使用系统的保留关键字,不然可能数据表创建成功了,但是在使用环节(增删改查)等,造成极大的不变,重则甚至返工修改字段。
所以,在建表前一定要排查一下建表字段是否与mysql保留关键字是否冲突,尤其是一些常用的因为单词。
关键字收集
A
ACTIVE
ADMIN
ARRAY
ATTRIBUTE
B
BUCKETS
C
CLONE
COMPONENT
CUME_DIST (R)
D
DEFINITION
DENSE_RANK (R)
DESCRIPTION
E
EMPTY (R)
ENFORCED
ENGINE_ATTRIBUTE
EXCEPT (R)
EXCLUDE
F
FAILED_LOGIN_ATTEMPTS
FIRST_VALUE (R)
FOLLOWING
G
GEOMCOLLECTION
GET_MASTER_PUBLIC_KEY
GROUPING (R)
GROUPS (R)
H
HISTOGRAM
HISTORY
I
INACTIVE
INVISIBLE
J
JSON_TABLE (R)
JSON_VALUE
L
LAG (R)
LAST_VALUE (R)
LATERAL (R)
LEAD (R)
LOCKED
M
MANAGED
MASTER_COMPRESSION_ALGORITHMS
MASTER_PUBLIC_KEY_PATH
MASTER_TLS_CIPHERSUITES
MASTER_ZSTD_COMPRESSION_LEVEL
MEMBER
N
NESTED
NETWORK_NAMESPACE
NOWAIT
NTH_VALUE (R)
NTILE (R)
NULLS
O
OF (R)
OFF
OJ
OLD
OPTIONAL
ORDINALITY
ORGANIZATION
OTHERS
OVER (R)
P
PASSWORD_LOCK_TIME
PATH
PERCENT_RANK (R)
PERSIST
PERSIST_ONLY
PRECEDING
PRIVILEGE_CHECKS_USER
PROCESS
R
RANDOM
RANK (R)
RECURSIVE (R)
REFERENCE
REQUIRE_ROW_FORMAT
RESOURCE
RESPECT
RESTART
RETAIN
RETURNING
REUSE
ROLE
ROW_NUMBER (R)
S
SECONDARY
SECONDARY_ENGINE
SECONDARY_ENGINE_ATTRIBUTE
SECONDARY_LOAD
SECONDARY_UNLOAD
SKIP
SRID
STREAM
SYSTEM (R)
T
THREAD_PRIORITY
TIES
TLS
U
UNBOUNDED
V
VCPU
VISIBLE
W
WINDOW (R)
mysql8 中已经移除的关键字
ANALYSE
DES_KEY_FILE
PARSE_GCOL_EXPR
REDOFILE
SQL_CACHE
参考
Keywords and Reserved Words