我在通过脚本创建数据库时遇到了这个错误mysql数据库

mtb9vblg  于 2021-06-25  发布在  Mysql
关注(0)|答案(1)|浏览(349)
create table arpa_acc_perfil
(
   id_account           integer not null,
   dt_create            date,
   ind_active           tinyint,
   tp_servicio          set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'),
   tp_propiedad         set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'),
   set_properties       set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'),
   ind_piscina          tinyint,
   num_parking          smallint,
   num_wc               smallint,
   num_dormitorios      smallint,
   int_superficie_const smallint,
   int_superficie       smallint,
   precio_alquiler      decimal(10,0),
   precio_compra        decimal(10,0),
   txt_comment          varchar(255),
   primary key (id_account)
)

type = innodb
character set = utf8
MySQL said: Documentation

1064-您的sql语法有错误;在第20行的“type=innodb character set=utf8”附近,检查与您的mariadb服务器版本相对应的手册中使用的正确语法

8xiog9wr

8xiog9wr1#

您的查询不正确

create table arpa_acc_perfil
(
   id_account           integer not null,
   dt_create            date,
   ind_active           tinyint,
   tp_servicio          set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'),
   tp_propiedad         set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'),
   set_properties       set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'),
   ind_piscina          tinyint,
   num_parking          smallint,
   num_wc               smallint,
   num_dormitorios      smallint,
   int_superficie_const smallint,
   int_superficie       smallint,
   precio_alquiler      decimal(10,0),
   precio_compra        decimal(10,0),
   txt_comment          varchar(255),
   primary key (id_account)
)

ENGINE=InnoDB
DEFAULT CHARSET = utf8

这是正确的查询。

相关问题