Home  >  Article  >  Database  >  What should I do if phpmyadmin reports an error when setting the ID primary key to auto-increment?

What should I do if phpmyadmin reports an error when setting the ID primary key to auto-increment?

藏色散人
藏色散人Original
2020-04-01 10:06:282682browse

What should I do if phpmyadmin reports an error when setting the ID primary key to auto-increment?

What should I do if phpmyadmin reports an error when setting the id primary key to auto-increment?

Beginners to PHP using phpmyadmin often encounter the problem of being unable to set the primary key to auto-increment when creating a table.

Only the sql statement can be used for help. In fact, it can be set in phpmyadmin. When modifying a field, drag it to the far right and you will see the auto-increment option.

Solution

LoginphpmyadminSelect a table in the database and select the structure.

Find the primary key that you want to set as auto-increment (if it has not been set yet, just click the key button).

Click [Modify].

In the row of field definitions displayed, drag the scroll bar of the browser to the far right to find the word A_I. This is the automatic value-added sign. Just tick it.

Click [Save], this time you will have an auto-incremented primary key.

The above is the detailed content of What should I do if phpmyadmin reports an error when setting the ID primary key to auto-increment?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn