Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Error SQL query:

-- 
-- 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 Flâmula 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

#1054 - Unknown column 'id' in 'field list' 
like image 848
user3002293 Avatar asked Jan 14 '14 11:01

user3002293


3 Answers

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...

like image 53
Taylor Cox Avatar answered Oct 19 '22 10:10

Taylor Cox


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

like image 27
ErichBSchulz Avatar answered Oct 19 '22 08:10

ErichBSchulz


Try to replace:

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

with:

INSERT INTO `bi_instituicoes` (id, 

My guess is that the column id is not lower-case. This kind of confusion happens to many people.

like image 1
Nir Alfasi Avatar answered Oct 19 '22 08:10

Nir Alfasi