I am trying to create a new table using the mysql GUI in phpmyadmin. This is the error I am getting #1072 – Key column ‘id ‘ doesn’t exist in table
CREATE TABLE `loginsys`.`groups`(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(20) NOT NULL,
`permission` TEXT NOT NULL,
PRIMARY KEY(`id `)
) ENGINE = InnoDB
2
Answers
simply run the query without “`”
CREATE TABLE loginsys.groups(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
permission TEXT NOT NULL,
PRIMARY KEY(id))
Please correct the extra space in when you’re defining
PRIMARY KEY(
id)
This should be your query :-