MySQL| MySQL关键字和保留字
MySQL 5.5 Keywords and Reserved Words
The following list shows the keywords and reserved words in MySQL 5.5, along with changes to individual words from version to version. Reserved keywords are marked with (R). In addition, _FILENAME
is reserved.
At some point, you might upgrade to a higher version, so it is a good idea to have a look at future reserved words, too. You can find these in the manuals that cover higher versions of MySQL. Most of the reserved words in the list are forbidden by standard SQL as column or table names (for example, GROUP
). A few are reserved because MySQL needs them and uses a yacc parser.
A
ACCESSIBLE
(R)ACTION
ADD
(R)AFTER
AGAINST
AGGREGATE
ALGORITHM
ALL
(R)ALTER
(R)ANALYZE
(R)AND
(R)ANY
AS
(R)ASC
(R)ASCII
ASENSITIVE
(R)AT
AUTHORS
AUTOEXTEND_SIZE
AUTO_INCREMENT
AVG
AVG_ROW_LENGTH
B
BACKUP
BEFORE
(R)BEGIN
BETWEEN
(R)BIGINT
(R)BINARY
(R)BINLOG
BIT
BLOB
(R)BLOCK
BOOL
BOOLEAN
BOTH
(R)BTREE
BY
(R)BYTE
C
CACHE
CALL
(R)CASCADE
(R)CASCADED
CASE
(R)CATALOG_NAME
CHAIN
CHANGE
(R)CHANGED
CHAR
(R)CHARACTER
(R)CHARSET
CHECK
(R)CHECKSUM
CIPHER
CLASS_ORIGIN
CLIENT
CLOSE
COALESCE
CODE
COLLATE
(R)COLLATION
COLUMN
(R)COLUMNS
COLUMN_NAME
COMMENT
COMMIT
COMMITTED
COMPACT
COMPLETION
COMPRESSED
CONCURRENT
CONDITION
(R)CONNECTION
CONSISTENT
CONSTRAINT
(R)CONSTRAINT_CATALOG
CONSTRAINT_NAME
CONSTRAINT_SCHEMA
CONTAINS
CONTEXT
CONTINUE
(R)CONTRIBUTORS
CONVERT
(R)CPU
CREATE
(R)CROSS
(R)CUBE
CURRENT_DATE
(R)CURRENT_TIME
(R)CURRENT_TIMESTAMP
(R)CURRENT_USER
(R)CURSOR
(R)CURSOR_NAME
D
DATA
DATABASE
(R)DATABASES
(R)DATAFILE
DATE
DATETIME
DAY
DAY_HOUR
(R)DAY_MICROSECOND
(R)DAY_MINUTE
(R)DAY_SECOND
(R)DEALLOCATE
DEC
(R)DECIMAL
(R)DECLARE
(R)DEFAULT
(R)DEFINER
DELAYED
(R)DELAY_KEY_WRITE
DELETE
(R)DESC
(R)DESCRIBE
(R)DES_KEY_FILE
DETERMINISTIC
(R)DIRECTORY
DISABLE
DISCARD
DISK
DISTINCT
(R)DISTINCTROW
(R)DIV
(R)DO
DOUBLE
(R)DROP
(R)DUAL
(R)DUMPFILE
DUPLICATE
DYNAMIC
E
EACH
(R)ELSE
(R)ELSEIF
(R)ENABLE
ENCLOSED
(R)END
ENDS
ENGINE
ENGINES
ENUM
ERROR
added in 5.5.3 (nonreserved)ERRORS
ESCAPE
ESCAPED
(R)EVENT
EVENTS
EVERY
EXECUTE
EXISTS
(R)EXIT
(R)EXPANSION
EXPLAIN
(R)EXTENDED
EXTENT_SIZE
F
FALSE
(R)FAST
FAULTS
FETCH
(R)FIELDS
FILE
FIRST
FIXED
FLOAT
(R)FLOAT4
(R)FLOAT8
(R)FLUSH
FOR
(R)FORCE
(R)FOREIGN
(R)FOUND
FRAC_SECOND
removed in 5.5.3FROM
(R)FULL
FULLTEXT
(R)FUNCTION
G
GENERAL
added in 5.5.3 (reserved); became nonreserved in 5.5.8GEOMETRY
GEOMETRYCOLLECTION
GET_FORMAT
GLOBAL
GRANT
(R)GRANTS
GROUP
(R)
H
HANDLER
HASH
HAVING
(R)HELP
HIGH_PRIORITY
(R)HOST
HOSTS
HOUR
HOUR_MICROSECOND
(R)HOUR_MINUTE
(R)HOUR_SECOND
(R)
I
IDENTIFIED
IF
(R)IGNORE
(R)IGNORE_SERVER_IDS
became nonreserved in 5.5.8IMPORT
IN
(R)INDEX
(R)INDEXES
INFILE
(R)INITIAL_SIZE
INNER
(R)INNOBASE
removed in 5.5.3INNODB
removed in 5.5.3INOUT
(R)INSENSITIVE
(R)INSERT
(R)INSERT_METHOD
INSTALL
INT
(R)INT1
(R)INT2
(R)INT3
(R)INT4
(R)INT8
(R)INTEGER
(R)INTERVAL
(R)INTO
(R)INVOKER
IO
IO_THREAD
IPC
IS
(R)ISOLATION
ISSUER
ITERATE
(R)
J
JOIN
(R)
K
KEY
(R)KEYS
(R)KEY_BLOCK_SIZE
KILL
(R)
L
LANGUAGE
LAST
LEADING
(R)LEAVE
(R)LEAVES
LEFT
(R)LESS
LEVEL
LIKE
(R)LIMIT
(R)LINEAR
(R)LINES
(R)LINESTRING
LIST
LOAD
(R)LOCAL
LOCALTIME
(R)LOCALTIMESTAMP
(R)LOCK
(R)LOCKS
LOGFILE
LOGS
LONG
(R)LONGBLOB
(R)LONGTEXT
(R)LOOP
(R)LOW_PRIORITY
(R)
M
MASTER
MASTER_CONNECT_RETRY
MASTER_HEARTBEAT_PERIOD
became nonreserved in 5.5.8MASTER_HOST
MASTER_LOG_FILE
MASTER_LOG_POS
MASTER_PASSWORD
MASTER_PORT
MASTER_SERVER_ID
MASTER_SSL
MASTER_SSL_CA
MASTER_SSL_CAPATH
MASTER_SSL_CERT
MASTER_SSL_CIPHER
MASTER_SSL_KEY
MASTER_SSL_VERIFY_SERVER_CERT
(R)MASTER_USER
MATCH
(R)MAXVALUE
(R)MAX_CONNECTIONS_PER_HOUR
MAX_QUERIES_PER_HOUR
MAX_ROWS
MAX_SIZE
MAX_UPDATES_PER_HOUR
MAX_USER_CONNECTIONS
MEDIUM
MEDIUMBLOB
(R)MEDIUMINT
(R)MEDIUMTEXT
(R)MEMORY
MERGE
MESSAGE_TEXT
MICROSECOND
MIDDLEINT
(R)MIGRATE
MINUTE
MINUTE_MICROSECOND
(R)MINUTE_SECOND
(R)MIN_ROWS
MOD
(R)MODE
MODIFIES
(R)MODIFY
MONTH
MULTILINESTRING
MULTIPOINT
MULTIPOLYGON
MUTEX
MYSQL_ERRNO
N
NAME
NAMES
NATIONAL
NATURAL
(R)NCHAR
NDB
NDBCLUSTER
NEW
NEXT
NO
NODEGROUP
NONE
NOT
(R)NO_WAIT
NO_WRITE_TO_BINLOG
(R)NULL
(R)NUMERIC
(R)NVARCHAR
O
OFFSET
OLD_PASSWORD
ON
(R)ONE
ONE_SHOT
OPEN
OPTIMIZE
(R)OPTION
(R)OPTIONALLY
(R)OPTIONS
OR
(R)ORDER
(R)OUT
(R)OUTER
(R)OUTFILE
(R)OWNER
P
PACK_KEYS
PAGE
PARSER
PARTIAL
PARTITION
PARTITIONING
PARTITIONS
PASSWORD
PHASE
PLUGIN
PLUGINS
POINT
POLYGON
PORT
PRECISION
(R)PREPARE
PRESERVE
PREV
PRIMARY
(R)PRIVILEGES
PROCEDURE
(R)PROCESSLIST
PROFILE
PROFILES
PROXY
added in 5.5.7 (nonreserved)PURGE
(R)
Q
QUARTER
QUERY
QUICK
R
RANGE
(R)READ
(R)READS
(R)READ_ONLY
READ_WRITE
(R)REAL
(R)REBUILD
RECOVER
REDOFILE
REDO_BUFFER_SIZE
REDUNDANT
REFERENCES
(R)REGEXP
(R)RELAY
added in 5.5.3 (nonreserved)RELAYLOG
RELAY_LOG_FILE
RELAY_LOG_POS
RELAY_THREAD
RELEASE
(R)RELOAD
REMOVE
RENAME
(R)REORGANIZE
REPAIR
REPEAT
(R)REPEATABLE
REPLACE
(R)REPLICATION
REQUIRE
(R)RESET
RESIGNAL
(R)RESTORE
RESTRICT
(R)RESUME
RETURN
(R)RETURNS
REVOKE
(R)RIGHT
(R)RLIKE
(R)ROLLBACK
ROLLUP
ROUTINE
ROW
ROWS
ROW_FORMAT
RTREE
S
SAVEPOINT
SCHEDULE
SCHEMA
(R)SCHEMAS
(R)SCHEMA_NAME
SECOND
SECOND_MICROSECOND
(R)SECURITY
SELECT
(R)SENSITIVE
(R)SEPARATOR
(R)SERIAL
SERIALIZABLE
SERVER
SESSION
SET
(R)SHARE
SHOW
(R)SHUTDOWN
SIGNAL
(R)SIGNED
SIMPLE
SLAVE
SLOW
added in 5.5.3 (reserved); became nonreserved in 5.5.8SMALLINT
(R)SNAPSHOT
SOCKET
SOME
SONAME
SOUNDS
SOURCE
SPATIAL
(R)SPECIFIC
(R)SQL
(R)SQLEXCEPTION
(R)SQLSTATE
(R)SQLWARNING
(R)SQL_BIG_RESULT
(R)SQL_BUFFER_RESULT
SQL_CACHE
SQL_CALC_FOUND_ROWS
(R)SQL_NO_CACHE
SQL_SMALL_RESULT
(R)SQL_THREAD
SQL_TSI_DAY
SQL_TSI_FRAC_SECOND
removed in 5.5.3SQL_TSI_HOUR
SQL_TSI_MINUTE
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_SECOND
SQL_TSI_WEEK
SQL_TSI_YEAR
SSL
(R)START
STARTING
(R)STARTS
STATUS
STOP
STORAGE
STRAIGHT_JOIN
(R)STRING
SUBCLASS_ORIGIN
SUBJECT
SUBPARTITION
SUBPARTITIONS
SUPER
SUSPEND
SWAPS
SWITCHES
T
TABLE
(R)TABLES
TABLESPACE
TABLE_CHECKSUM
TABLE_NAME
TEMPORARY
TEMPTABLE
TERMINATED
(R)TEXT
THAN
THEN
(R)TIME
TIMESTAMP
TIMESTAMPADD
TIMESTAMPDIFF
TINYBLOB
(R)TINYINT
(R)TINYTEXT
(R)TO
(R)TRAILING
(R)TRANSACTION
TRIGGER
(R)TRIGGERS
TRUE
(R)TRUNCATE
TYPE
TYPES
U
UNCOMMITTED
UNDEFINED
UNDO
(R)UNDOFILE
UNDO_BUFFER_SIZE
UNICODE
UNINSTALL
UNION
(R)UNIQUE
(R)UNKNOWN
UNLOCK
(R)UNSIGNED
(R)UNTIL
UPDATE
(R)UPGRADE
USAGE
(R)USE
(R)USER
USER_RESOURCES
USE_FRM
USING
(R)UTC_DATE
(R)UTC_TIME
(R)UTC_TIMESTAMP
(R)
V
VALUE
VALUES
(R)VARBINARY
(R)VARCHAR
(R)VARCHARACTER
(R)VARIABLES
VARYING
(R)VIEW
W
WAIT
WARNINGS
WEEK
WHEN
(R)WHERE
(R)WHILE
(R)WITH
(R)WORK
WRAPPER
WRITE
(R)
X
X509
XA
XML
XOR
(R)
Y
YEAR
YEAR_MONTH
(R)
Z
ZEROFILL
(R)
MySQL 5.5 New Keywords and Reserved Words
The following list shows the keywords and reserved words that are added in MySQL 5.5, compared to MySQL 5.1. Reserved keywords are marked with (R).
C
CATALOG_NAME
CLASS_ORIGIN
COLUMN_NAME
CONSTRAINT_CATALOG
CONSTRAINT_NAME
CONSTRAINT_SCHEMA
CURSOR_NAME
E
ERROR
G
GENERAL
I
IGNORE_SERVER_IDS
M
MASTER_HEARTBEAT_PERIOD
MESSAGE_TEXT
MYSQL_ERRNO
P
PROXY
R
RELAY
RELAYLOG
RESIGNAL
(R)
S
SCHEMA_NAME
SIGNAL
(R)SLOW
SUBCLASS_ORIGIN
T
TABLE_NAME
X
XML
MySQL 5.5 Removed Keywords and Reserved Words
The following list shows the keywords and reserved words that are removed in MySQL 5.5, compared to MySQL 5.1. Reserved keywords are marked with (R).
FRAC_SECOND
INNOBASE
INNODB
SQL_TSI_FRAC_SECOND
参考: https://dev.mysql.com/doc/refman/5.5/en/keywords.html#keywords-5-5-detailed-I
MySQL| MySQL关键字和保留字的更多相关文章
- [转]MySql 5.7关键字和保留字-附表
原文地址:https://www.cnblogs.com/Z-Fanghan/p/6892944.html 现在使用navicat图形界面或者Hibernate做映射生成表的时候,渐渐的会忽视掉关键字 ...
- mysql中避免使用保留字和关键字做列的名字
设计数据表时,应尽量避免使用MySQL的关键字和保留字作为表名或列名. 比如key和keys为保留字,如果不小心使用关键字或者保留字作为列名字,执行下面的语句会出现语法错误: select * fro ...
- MySql 5.7关键字和保留字-附表
现在使用navicat图形界面或者Hibernate做映射生成表的时候,渐渐的会忽视掉关键字这个问题,而后续也会不断的产生错误提示,一遍遍的查询代码无果,甚至开始怀疑人生,但是其实很多情况下只是使用了 ...
- 表字段或表名出现Mysql关键字或保留字导致问题 Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have
MySQL 5.7使用的关键字和保留字 https://dev.mysql.com/doc/refman/5.7/en/keywords.html 当我们建表的时候如果使用了关键字或者保留字,则在执行 ...
- MySQL关键字(保留字)列表
在使用MySQL的时候,一般尽量避免用关键字作为表名,如使用关键字做表名,需要按标准写法给SQL语句加[](或是“)区分字段名和表名. 下面列出MySQL所有关键字,希望给使用MySQL的朋友提供一些 ...
- MySQL保留关键字
今天在使用hibernate关联映射导出表的时候因为映射了一个表名为option,是MYSQL的关键字,总是生成错误,一开始以为是映射文件和代码问题,检查不出问题才想到可能用到数据库的保留关键字了,查 ...
- MySql 分页关键字(limit)
mysql分页关键字: limit m,n --m:表示从哪一行开始查,n:查询多少条 oracle分页关键字:: rownum SqlServer:top(2005以下版本) row_number ...
- MySQL字段名与保留字冲突的问题及解决方法
问题:MySQL字段名与保留字冲突在实际操作是常常出现的.一把会出现下面错误. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException. 解 ...
- mysql status关键字 数据表设计中慎重使用
mysql status关键字 数据表设计中慎重使用
- mysql JOIN关键字 语法
mysql JOIN关键字 语法 作用:用于根据两个或多个表中的列之间的关系,从这些表中查询数据.大理石量具 说明:数据库中的表可通过键将彼此联系起来.主键(Primary Key)是一个列,在这个列 ...
随机推荐
- 怎样修改 VS Code 主题?
方法1. 点击左上角 File > Preferences > Color Theme. 方法2. 使用快捷键: Ctrl + K , Ctrl + T PS: 查询各种操作的快捷键可以 ...
- hdu 1087最长上升子序列和问题
看来大佬的dp思路,在这里就简单的总结下吧. 拿到一个问题,先得考虑是否适用dp算法. 1,找到最优解的结构,看其子问题是否也满足最优化(子问题最优化问题) 2, 看时候有子问题重叠 确定一个问题可 ...
- javascript——HTML对象
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- c#连接数据库SqlHelper报错
这是一个困扰了我好几天的问题,首先看一下报错信息 代码: private static string connectionString = ConfigurationManager.Connectio ...
- 【css】浅谈BFC
定义: 块格式化上下文(Block Formatting Context,BFC) 是Web页面的可视化CSS渲染的一部分,是块盒子的布局过程发生的区域,也是浮动元素与其他元素交互的区域. BFC的布 ...
- SpringBoot-JPA入门
SpringBoot-JPA入门 JPA就是Spring集成了hibernate感觉. 注解,方法仓库(顾名思义的方法,封装好了,还有自定义的方法). 案例: spring: datasource: ...
- Stanford NLP 课堂笔记之正则表达式
1.[]表达式的用法 正则表达式可以让我们匹配我们想要的字符串形式,增加了效率,在自然语言处理领域有较大的作用. 模式 匹配 [Ww]oodchuck Woodchuck,woodchuck [123 ...
- 6.B+Tree 检索原理
B+树的创建(索引的创建) 1.比如为phoneNum创建了一个索引,phoneNum这列保存了很多的手机号码 2.索引创建的过程中,会为这些数据进行适当的编码(根据这个数据所在的物理地址),如 36 ...
- 程序面试题——C实现
平台:win10 x64 +VC6.0 2019/5/22 1.合并三个有序的链表 链表节点定义struct node{ int val; struct node* next;}; str ...
- PPP协议解析一
转:http://blog.csdn.net/yangzheng_yz/article/details/11526475 在网上搜集了一些有关PPP的资料,整理了一下,不能说是原创,仅供大家学习研究. ...