An error occurs when inserting data in MySQL: [err] 1064 – you have an error in your SQL syntax; Check the manual that responses to your MySQL server version for the right syntax to use near ‘key, enkey, content) values (‘1’, ‘1’, ‘1’, ‘1’, ‘1’, Shijiazhuang ‘)’ at line 1
My SQL statement is: insert into doclist (title, entity, Zhiyao, enzhiyao, key, enkey, content) values (‘1 ‘,’ 1 ‘,’ 1 ‘,’ 1 ‘,’ 1 ‘,’ Shijiazhuang ‘). It seems that the SQL statement is correct, but it doesn’t run successfully. According to the error information, we can know that the error is near key, enkey and content,
The key is marked in blue, which represents the keyword. The common attribute conflicts with the keyword. The information on the Internet says to add any back quotation marks. If I want to change the name of the key directly, it’s fast and simple. Finally, change the key to keyw, and the operation data is inserted successfully.
Similar Posts:
- Treatment of MySQL database keyword as column name by mybatisplus — sqlsyntax errorexception: you have an error in your SQL syntax;
- pymysql.err.OperationalError: (1054, “Unknown column’aa’in’field list’)
- MySQL error message: subquery returns more than 1 row and its solution
- [Solved] MYSQL ERROR 1290 (HY000): The MySQL server is running with the –secure-file-priv option so it cannot e…
- [Solved] Error: bash: syntax error near unexpected token ` (‘
- [Solved] MYSQL ERROR 1093 – You can’t specify target table ‘readbook’ for update in FROM clause
- IDEA Connect MYSQL Error: You have an error in your SQL syntax : ‘OPTION SQL_SELECT_LIMIT=1000’ (or…
- MySQL database insert into statement with parameters Error
- Data truncation: Data too long for column ‘****’
- [Solved] string(81) “SQLSTATE[HY000]: General error: 1364 Field ‘content’ doesn’t have a default value”