Error: 1075

Maken89Maken89 DenverPosts: 1 New member
I've google a bit about this can't seem to find a straight answer. Has anyone got the MySQL Error: 1075?
What does this errorcode mean?

Answers

  • bowensbowens Posts: 1 New member
    MySQL is returning that error because there is no unique index defined on the idcolumn. (MySQL requires that there be a unique index. The other possibility, which you would have already figured out, is that there can be only one column defined as AUTO_INCREMENT within the table.) 
    See more: https://www.repairtoolbox.com/mysqlrepair.html

  • MySQL is returning that error (most likely) because there is no unique index defined on the idcolumn. (MySQL requires that there be a unique index. The other possibility, which you would have already figured out, is that there can be only one column defined as AUTO_INCREMENT within the table.)

    To get that column to be an AUTO_INCREMENT, you can add either a UNIQUE constraint or a PRIMARY KEY constraint on the id column. For example:

    ALTER TABLE `blog` ADD CONSTRAINT `blog_ux` UNIQUE (`id`) ;

    (Note that this statement will return an error if any duplicate values exist for the id column.)

    Alternatively, you can make the id column the PRIMARY KEY of the table (if the table doesn't already have a PRIMARY KEY constraint defined).

    ALTER TABLE `blog` ADD PRIMARY KEY (`id`) ;

    (Note that this statement will return an error if any duplicate value exist for the id column, OR if there are any NULL values stored in that column, of if there is already a PRIMARY KEY constraint defined on the table.)

    If it still doesn't work,try this: https://docsbay.net/mysql-php-newbie

    Or try this: CREATE TABLE `testing` (


    `id` INT NOT NULL AUTO_INCREMENT, `date` DATE NOT NULL, `text_1` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `text_2` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE = MYISAM ;
Sign In or Register to comment.