Home  >  Article  >  Database  >  What should I do if the id of the MySQL database does not increase?

What should I do if the id of the MySQL database does not increase?

黄舟
黄舟Original
2017-08-08 15:27:012053browse

After the data was submitted successfully, the ID of the MYSQL database did not increase. I was very puzzled. After a closer look, I found the problem. It turned out that the ID of the data field was 0, which caused the ID not to increase.

What should I do if the id of the MySQL database does not increase?

1. Take registration as an example, use a browser to open the registration interface, fill in the registration information, as follows Show.

What should I do if the id of the MySQL database does not increase?


#2. Then click submit and registration will appear Success interface, this interface is normal and not controversial.

What should I do if the id of the MySQL database does not increase?


#3. Next let’s look at the database , we see that the ID of the database is 0, and the correct ID starts from 1.

What should I do if the id of the MySQL database does not increase?


##4. When we continue in the data When adding data, it will not be successful, and the error "Duplicate entry '0' for key 'PRIMARY' will appear."

What should I do if the id of the MySQL database does not increase?5. In this case, we need to change the ID of the database, let the data grow automatically, and open the database Structure, find the ID, and click Modify in the lower left corner, as the arrow has pointed out.

What should I do if the id of the MySQL database does not increase?


##6. Enter the modification interface and find A_I option, check the option, and click Go.

What should I do if the id of the MySQL database does not increase?

##7. After the modification is successful, there will be Tips below.

What should I do if the id of the MySQL database does not increase?

##8. After successfully modifying the database, we continue Add data and find that the addition is successful and the data ID starts from 1.

What should I do if the id of the MySQL database does not increase?

##9. This is not yet verification. At the end, we continue to add registration data and find that the ID is increasing, which indicates that the problem is solved.


The above is the detailed content of What should I do if the id of the MySQL database does not increase?. 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