# Error 1075: Incorrect table definition; there can be only one auto column and it must be defined as

| Error Code | SQLSTATE | Error                | Description                                                                                   |
| ---------- | -------- | -------------------- | --------------------------------------------------------------------------------------------- |
| 1075       | 42000    | ER\_WRONG\_AUTO\_KEY | Incorrect table definition; there can be only one auto column and it must be defined as a key |

## Possible Causes and Solutions

There can only be one [AUTO\_INCREMENT](/docs/server/reference/data-types/auto_increment.md) column per table, and the column must be defined as a [key](/docs/server/mariadb-quickstart-guides/mariadb-indexes-guide.md). Not adhering to either of these restrictions will result in this error. For example:

```
CREATE OR REPLACE TABLE animals (
    id1 MEDIUMINT NOT NULL AUTO_INCREMENT,
    id2 TINYINT NOT NULL AUTO_INCREMENT,
    name CHAR(30) NOT NULL,
    PRIMARY KEY (id1),
    KEY (id2)
);
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key


CREATE OR REPLACE TABLE animals (
    id1 MEDIUMINT NOT NULL AUTO_INCREMENT,
    name CHAR(30) NOT NULL
);
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key


CREATE OR REPLACE TABLE animals (
    id MEDIUMINT NOT NULL AUTO_INCREMENT,
    name CHAR(30) NOT NULL,
    PRIMARY KEY (id)
);
Query OK, 0 rows affected (0.017 sec)
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1000-to-1099/e1075.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
