Max Max - 1 year ago 114
MySQL Question

#1064 - You have an error in your SQL syntax.... near 'TYPE=MyISAM AUTO_INCREMENT=1' at line 15

I tried to import tables from a phpMyAdmin to phpMyAdmin I exporded the file as MYSQL40.

CREATE TABLE IF NOT EXISTS `82umK_commentmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`comment_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) DEFAULT NULL,
`meta_value` longtext,
PRIMARY KEY (`meta_id`),
KEY `comment_id` (`comment_id`),
KEY `meta_key` (`meta_key`(191))

My SQL said:

#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=MyISAM AUTO_INCREMENT=1' at line 15

Answer Source

The MySQL 4.x documentation says:

The ENGINE and TYPE options specify the storage engine for the table. ENGINE was added in MySQL 4.0.18 (for 4.0) and 4.1.2 (for 4.1). It is the preferred option name as of those versions, and TYPE has become deprecated. TYPE is supported throughout the 4.x series, but likely will be removed in the future.

By the MySQL 5.0 documentation (circa 2005), the TYPE= syntax is not mentioned.

So you're using syntax that was removed from the product over ten years ago.

I have to comment also that you should not use MyISAM.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download