Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL syntax error when specifying innodb database type and character set

I cant seem to import my tables.sql to a database called callumba_login. Here is the SQL:

CREATE TABLE Country(
    country_code                char(2) not null,
    country_name                varchar(60) not null,
    primary key(country_code)
    )type=innodb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

MySQL says:

#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 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci at line 5

like image 831
user3657631 Avatar asked Dec 12 '25 17:12

user3657631


1 Answers

The error message points you directly to the bad syntax.

type=innodb should be engine=innodb.

like image 185
Barmar Avatar answered Dec 15 '25 12:12

Barmar