Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create table with mysql and set TYPE=InnoDB in the sql string

I want to create a mysql table with this code:

create table geodb_type_names (
  type_id              integer not null,
  type_locale          varchar(5) not null,
  name                 varchar(255) not null,             /* varchar(500)? */
unique (type_id, type_locale)
) TYPE=InnoDB CHARACTER SET utf8;

It comes from a mysql dump for OpenGeoDb.

So I didn't create it by myself. If I include this statement in phpmyadmin I get this error message:

#1064 - 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 CHARACTER SET utf8' at line 10 

But I can't find the issue. Maybe someone can help me?

Thanks a lot.

like image 222
cgee Avatar asked Oct 20 '25 05:10

cgee


1 Answers

TYPE is replaced by ENGINE. TYPE was deprecated in MySQL 4.0 and removed in MySQL 5.5.

Use this query:

create table geodb_type_names (
  type_id              integer not null,
  type_locale          varchar(5) not null,
  name                 varchar(255) not null,             /* varchar(500)? */
unique (type_id, type_locale)
) ENGINE=InnoDB CHARACTER SET utf8;
like image 124
Aman Aggarwal Avatar answered Oct 21 '25 18:10

Aman Aggarwal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!