Greetings As I understand it, an increment by one with the auto_increment option occurs on any access to the table? and how to make the lines increment only when writing? Thanks in advance)
In the normal case,
auto_increment works only when adding a new record, if the value of the primary key is not explicitly specified.
If the primary key is specified explicitly and the value to be set is greater than the current value of
auto_increment , then
auto_increment recalculated (maximum value is + 1). The same thing happens when updating the value of the
auto_increment -th key.