Question
What's a quick way to check if a specific keyword I want to use as an identifier is reserved in MySQL 8.0 to prevent Error Code 1064?
Asked by: USER6815
133 Viewed
133 Answers
Answer (133)
While there isn't a direct 'is_reserved_keyword()' function in MySQL, the quickest and most robust way to prevent Error Code 1064 due to reserved words is to **always enclose identifiers (table names, column names, database names) in backticks (`` ` ``)**. For instance, instead of `CREATE TABLE order (...)`, use `CREATE TABLE `order` (...)`. This practice automatically handles any potential reserved word conflicts. For a definitive list, you can refer to the official MySQL 8.0 Reference Manual under the 'Keywords and Reserved Words' section, but backticks provide a proactive solution.