MySQL navicat 图形化管理工具报错,特在此请教。
对数据库增添数据,但报错1064。新手入门。
insert语句中表的名称打错了,不是empioee,需要修改为你上面创建的表名:employee 麻烦采纳下!!!!
insert语句中表名错了,正确应该是:
insert into employee(id, name, gender, salary) values (1, '张三', '男', 2000);
还有就是你创建表时没有申明字符集类型,插入中文的时候可能会报错:
Incorrect string value: '\xE5\xBC\xA0\xE4\xB8\x89' for column `00000`.`employee`.`name` at row 1
避免此错误的方法为:在创建表时申请字符集类型
-- 需要先删除原表后再创建,不然create的时候不会创建了
drop table emplyee;
create table if not exists employee (
id int,
name varchar(20),
gender varchar(10),
salary double
) CHARSET=utf8mb4;
insert into employee(id, name, gender, salary) values (1, '张三', '男', 2000);
表名写错了,应该是employee,另外括号和value之间要有空格
两类问题:
1、表名写错了;
2、应该用英文的引号和逗号
有帮助的话,请点采纳呀~