我通过脚本创建数据库时遇到此错误。 MySQL的

时间:2016-10-06 12:50:25

标签: php mysql phpmyadmin mysql-error-1064 php-mysqlidb

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语法出错;检查与MariaDB服务器版本对应的手册,以便在'type = innodb附近使用正确的语法   第20行的字符集= utf8'

1 个答案:

答案 0 :(得分:2)

您的查询不正确

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

这是正确的查询。