You are Here:
FAQ
Scripting and Programming Languages
MySQL Database
Article #2
What is a MySQL Reserved Word? Linux Packages Only!
This includes: 1&1 Beginner (Linux) 1&1 Home (Linux) 1&1 Business (Linux) 1&1 Developer (Linux) 1&1 Dedicated Website Servers (formerly called managed servers)MySQL has a multitude of functions and identifiers which are designated Reserved Words. Since these Reserved Words have special meaning or functions within the MySQL language, it is best to avoid using them as table, column or field names if at all possible. The best known are CREATE, SELECT, UPDATE and DROP. These reserved words are used as commands in MySQL for performing database operations. These commands are used to create, change or delete databases and datasets. Reserved Words in MySQL are usually uppercase to distinguish them from the rest of the MySQL command in documentation, syntax examples, etc. but are actually case-insensitive. While you may be able to type MySQL Reserved Words in all lowercase without functionality being compromised, it is best practice to follow the de facto standard. There is a different list of reserved words for each version of MySQL due to the introduction of new functions. The list of reserved words is backwards compatible. In other words, the terms that were reserved in MySQL 4.0 are still reserved in the current release of MySQL. Reserved words in MySQL 4.1 and above: ASENSITIVE CALL CONDITION CONTINUE CURSOR DECLARE DETERMINISTIC EACH ELSEIF EXIT FETCH INOUT INSENSITIVE ITERATE LEAVE LOOP MODIFIES OUT READS RELEASE REPEAT RETURN SCHEMA SCHEMAS SENSITIVE SPECIFIC SQL SQLEXCEPTION SQLSTATE SQLWARNING TRIGGER UNDO WHILE Reserved words in MySQL 5.1 and above: ACCESSIBLE LINEAR MASTER_SSL_VERIFY_SERVER_CERT RANGE READ_ONLY READ_WRITE If you wish to use any of these reserved words in your field names, it is necessary to escape them using quotation marks or include the table name. Example of the use of the reserved word "RANGE": Incorrect:
Correct using quotation marks:
Correct using the table name:
For more information, please reference: MySQL :: MySQL 5.1 Reference Manual :: 8.3 Reserved Words |
© 2008 1&1 Internet Inc - About 1&1 Internet