mysql - 我正在尝试通过 mysql-shell 将一些数据放入 mysql 但它不起作用
问题描述
当我在 MySQL-shell 中触发此查询时,它会引发错误。我不知道为什么它会引发错误。
INSERT INTO course_metadata_organization
(partner, key, name) VALUES ('1', 'test', 'Norway');
错误:
ERROR 1064 (42000): You have an error in your SQL syntax;
check the manual that corresponds to your MySQL
server version for the right syntax to use near 'key, name)
VALUES ('1', 'test', 'Norway')' at line 1
解决方案
INSERT INTO course_metadata_organization
(`partner`, `key`, `name`) VALUES ('1', 'test', 'Norway');
使用 ` 作为列名
推荐阅读
- regex - 字符类中的正则表达式重复范围
- html - Visual Studio Code:在 CSS 中选择类后在浏览器中突出显示对象边框
- mysql - 成功完成 MySQL 触发器后如何返回消息
- c++ - CMake 找不到文件或目录
- javascript - React Native 在生产模式下仅显示启动画面
- c# - 基于需要在执行时间内接收更多项目的列表执行 Parallel.ForEach
- javascript - 第二次通过后阵列未重置
- typescript - Jest mockImplementation 不是一个函数,但可以与 require 一起使用
- bash - 如何在 Bash 脚本中使用 JQ 通过变量修改 json 文件?
- visual-studio - 调试时,Visual Studio 输出窗口转到“显示来自:生成的输出”