SQL #1054-“字段列表”中的未知列“id”-phpMyAdmin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21112839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 00:43:34  来源:igfitidea点击:

#1054 - Unknown column 'id' in 'field list' - phpMyAdmin

sqlphpmyadminmysql-error-1054

提问by user3002293

I've read my threads about this problem but I still don't know how to solve it.

我已经阅读了有关此问题的线程,但我仍然不知道如何解决它。

Error SQL query:

错误 SQL 查询:

-- 
-- Dump data for table `bi_instituicoes` 
--
INSERT INTO `bi_instituicoes` (`id`, `Instituicao`, `Morada`, `Código Postal`, `Localidade`, `País`) 
VALUES (1, 'Escola Secundária D. Afonso Sanches', 'Alameda Flamula Pais', NULL, 'Vila do Conde ', 'Portugal'), 
(2, 'Escola Secundária da Boa Nova', 'Av. dos Combatentes da Grande Guerra', NULL, 'Le?a da Palmeira ', 'Portugal'), 
(3, 'Escola Secundária da Maia', 'Avenida Luís Cam?es', '4470-322', 'Maia', 'Portugal'), 
(4, 'Escola Secundária de Almeida Garrett', 'Praceta Doutor José Sampaio', NULL, 'Vila Nova de Gaia ', 'Portugal'), 
(5, 'Escola Secundária de José Gomes Ferreira', 'Rua José Sebasti?o e Silva', NULL, 'Lisboa', 'Portugal'), 
(6, 'Escola Secundária de Monserrate', 'R. Monserrate', NULL, 'Viana do Castelo ', 'Portugal'), 
(7, 'Escola Secundária de Paredes', 'R. Engenheiro Adelino A Costa , Castel?es Cepeda', NULL, 'Paredes', 'Portugal'), 
(8, 'Escola Secundária de Raúl Proen?a, Leiria ', 'Rua Jo?o II[...]

MySQL said: Documentation

MySQL 说: 文档

#1054 - Unknown column 'id' in 'field list' 

回答by Taylor Cox

After hours of frustration with this issue, and trying to insert using every possible acceptable syntax, I found that the problem was a trigger on the table that I was inserting on. I haven't been able to find out why the Trigger caused the problem, but removing it allowed my inserts to work again...

经过数小时对这个问题的沮丧,并尝试使用所有可能的可接受的语法插入后,我发现问题是我正在插入的表上的触发器。我一直无法找出触发器导致问题的原因,但是删除它可以让我的插入物再次工作......

回答by ErichBSchulz

This can also be due to messed up triggers. Sometimes a show triggerscan help.

这也可能是由于触发器混乱造成的。有时show triggers可以提供帮助。

回答by ErichBSchulz

Perhaps the table bi_instituicoeshas no such field id- check its structure. Or if your Mysql by 5 version change query to:

也许该表bi_instituicoes没有这样的字段id- 检查其结构。或者,如果您的 Mysql 5 版本将查询更改为:

-- 
-- Dump data for table `bi_instituicoes` 
--
INSERT INTO `bi_instituicoes`
VALUES (1, 'Escola Secundária D. Afonso Sanches', 'Alameda Flamula Pais', NULL, 'Vila do Conde ', 'Portugal'), 
(2, 'Escola Secundária da Boa Nova', 'Av. dos Combatentes da Grande Guerra', NULL, 'Le?a da Palmeira ', 'Portugal'), 
(3, 'Escola Secundária da Maia', 'Avenida Luís Cam?es', '4470-322', 'Maia', 'Portugal'), 
(4, 'Escola Secundária de Almeida Garrett', 'Praceta Doutor José Sampaio', NULL, 'Vila Nova de Gaia ', 'Portugal'), 
(5, 'Escola Secundária de José Gomes Ferreira', 'Rua José Sebasti?o e Silva', NULL, 'Lisboa', 'Portugal'), 
(6, 'Escola Secundária de Monserrate', 'R. Monserrate', NULL, 'Viana do Castelo ', 'Portugal'), 
(7, 'Escola Secundária de Paredes', 'R. Engenheiro Adelino A Costa , Castel?es Cepeda', NULL, 'Paredes', 'Portugal'), 
(8, 'Escola Secundária de Raúl Proen?a, Leiria ', 'Rua Jo?o II[...]

回答by alfasin

Try to replace:

尝试替换:

INSERT INTO `bi_instituicoes` (`id`, ...

with:

和:

INSERT INTO `bi_instituicoes` (id, 

My guess is that the column idis notlower-case. This kind of confusion happens to many people.

我的猜测是,该列id不是小写。这种困惑发生在很多人身上。

回答by Anoukh

Simple solution is that a string must be within double quotations ".

简单的解决方案是字符串必须在双引号内"

Example:

例子:

INSERT INTO `bi_instituicoes`
VALUES (1, "Escola Secundária D. Afonso Sanches", "Alameda Flamula Pais", NULL, "Vila do Conde ", "Portugal");