Error creating a Mysql table

Asked

Viewed 1,023 times

5

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;

but caused 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

is because Power Designer is working with Mysql 5 and what is installed on my pc is Mysql 5.5

how do I resolve this problem? I’ll have to install Mysql 5 version?

2 answers

9


Change type for engine. The type was using 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."

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

Source

1

To fix this in power designer just edit the DBMS and go to MYSQL50::Script\Objects\Table\Options. Scroll the text up and you will 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 so:

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

See that I also changed the default for InnoDB, so when you create the table it already inserts as engine = InnoDB. This is done by simply saving as Mysql5.1 so that it does not override the DBMS of Mysql5.0.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.