MySQL カラム名・テーブル名などに使ってはいけないキーワード


MySQLでテーブル名やカラム名に使用できないワードの一覧まとめ

予約語を使うのは危険なので回避しましょう。
バッククオートで囲ってあげると使えるのが困った部分ですが・・・

ADD
ALL
ALTER
ANALYZE
AND
AS
ASC
BEFORE
BETWEEN
BIGINT
BINARY
BLOB
BOTH
BY
CASCADE
CASE
CHANGE
CHAR
CHARACTER
CHECK
COLLATE
COLUMN
COLUMNS
CONSTRAINT
CONVERT
CREATE
CROSS
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
DATABASE
DATABASES
DAY_HOUR
DAY_MICROSECOND
DAY_MINUTE
DAY_SECOND
DEC
DECIMAL
DEFAULT
DELAYED
DELETE
DESC
DESCRIBE
DISTINCT
DISTINCTROW
DIV
DOUBLE
DROP
DUAL
ELSE
ENCLOSED
ESCAPED
EXISTS
EXPLAIN
FALSE
FIELDS
FLOAT
FLOAT4
FLOAT8
FOR
FORCE
FOREIGN
FROM
FULLTEXT
GRANT GROUP
HAVING
HIGH_PRIORITY
HOUR_MICROSECOND
HOUR_MINUTE
HOUR_MIXROSECOND
HOUR_SECOND
IF
IGNORE
IN
INDEX
INFILE
INNER
INSERT
INT
INT1
INT2
INT3
INT4
INT8
INTEGER
INTERVAL
INTO
IS
JOIN
KEY
KEYS
KILL
LEADING
LEFT
LIKE
LIMIT
LINES
LOAD
LOCALTIME
LOCALTIMESTAMP
LOCK
LONG
LONGBLOB
LONGTEXT
LOW_PRIORITY
MATCH
MEDIUMBLOB
MEDIUMINT
MEDIUMTEXT
MIDDLEINT
MINUTE_MICROSECOND
MINUTE_SECOND
MOD
NATURAL
NO_WRITE_TO_BINLOG
NOT
NULL
NUMERIC
ON
OPTIMIZE
OPTION
OPTIONALLY
OR
ORDER
OUTER
OUTFILE
PRECISION
PRIMARY
PRIVILEGES
PROCEDURE
PURGE
RAID0
READ
REAL
REFERENCES
REGEXP
RENAME
REPLACE
REQUIRE
RESTRICT
REVOKE
RIGHT
RLIKE
SECOND_MICROSECOND
SELECT
SEPARATOR
SET
SHOW
SMALLINT
SONAME
SPATIAL
SQL_BIG_RESULT
SQL_CALC_FOUND_ROWS
SQL_SMALL_RESULT
SSL
STARTING
STRAIGHT_JOIN
TABLE
TABLES
TERMINATED
THEN
TINYBLOB
TINYINT
TINYTEXT
TO
TRAILING
TRUE
UNION
UNIQUE
UNLOCK
UNSIGNED
UPDATE
USAGE
USE
USING
UTC_DATE
UTC_TIME
UTC_TIMESTAMP
VALUES
VARBINARY
VARCHAR
VARCHARACTER
VARCHARCTER
VARYING
WHEN
WHERE
WITH
WRITE
X509
XOR
YEAR_MONTH
ZEROFILL

予約後はプログラムの落とし穴にもなりがちが部分ですし、覚えるより、開発環境を整えて、予約後ですよ!と知らせてもらいましょう。

SPONSORED LINK
トップへ戻る