MySQL Database FAQ

Source: Internet
Author: User

One

Q: If there is a table, there is a field ID of the self-increment primary key, when the table has been inserted 10 data, deleted the ID of 8,9,10 data, and then restart the MySQL, and then insert a data, then this data ID value should be how much, is 8, or 11?
A: If the table type is MyISAM, then it is 11. If the table is of type InnoDB, the ID is 8.
This is because the maximum ID records stored by the two types of storage engines are different, the MyISAM table records the maximum ID into the data file, and the maximum ID value for restarting the MySQL self-increment primary key is not lost;
InnoDB, in turn, records the maximum ID value into memory, so the maximum ID value will be lost after restarting MySQL or optimize the table.

MySQL Database FAQ

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.