Error creating a MySQL table

4

I created a table in Power Designer as shown below

create table BANCO
(
   COD_BANCO            integer not null auto_increment,
   NOME_BANCO           varchar(50),
   AGENCIA_BANCO        integer,
   CONTA_BANCO          integer,
   GERENTE_BANCO        varchar(20),
   FONE_BANCO           varchar(10),
   primary key (COD_BANCO)
)
type = InnoDB;

however, it generated this error

error 1064 (42000)You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type = InnoDB' at line 11

It's because Power Designer is working with MySQL 5 and what's installed on my pc is MySQL 5.5

How do I resolve this problem? will I have to install the MySQL 5 version?

    
asked by anonymous 08.06.2014 / 16:50

2 answers

8

Change% of% by% with%. type was used in older versions of MySQL.

  

" The older term TYPE is supported as a synonym for ENGINE for backward   compatibility, but ENGINE is the preferred term and TYPE is   deprecated. "

     

TYPE, the older term, is supported as a synonym for ENGINE for   compatibility with previous versions, but ENGINE is the   preferred and TYPE is obsolete.

Font

    
08.06.2014 / 16:57
1

To fix this in the power designer just edit the DBMS and go to MYSQL50::Script\Objects\Table\Options . Roll the text up and you'll find something like this in the Value field:

type = %s : list = BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM, default = MYISAM

Edit this line, leaving this:

engine = %s : list = BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM, default = InnoDB

See that I have also changed the default to InnoDB , so when you create the table it already inserts as engine = InnoDB . This is done by saving as MySQL5.1 so it does not overlap the MySQL5.0 DBMS.

    
11.09.2015 / 22:23