0

For context: I'm trying to set up an old Wordpress site on a staging server. When I try to upload the sql backup I receive the following error message:

>Error
>SQL query:

>--
-- Database: `db_name`
>--
-- --------------------------------------------------------
>--
>-- Table structure for table `wp_commentmeta`
>--
>CREATE TABLE IF NOT EXISTS  `wp_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
>) ENGINE = MYISAM AUTO_INCREMENT =3339 DEFAULT CHARSET = utf8;

>MySQL said: Documentation

>#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key 

>----------------------

I'm lousy with SQL so I was hoping if someone could help me decipher this.

dhrubo_moy
  • 1,144
  • 13
  • 31
  • 1
    the auto_inc needs to be in a key. Consider jamming `PRIMARY KEY` after it – Drew Sep 23 '16 at 19:59
  • Please see the top block of my answer [Here](http://stackoverflow.com/a/39553173) . Note it is for InnoDB. Also note my comment at the bottom of that block such that example 4 would be allowed in MyISAM – Drew Sep 23 '16 at 20:10

0 Answers0