Linux C operation mysql (5) encountered a problem: writing an incremented ID number

Requirement description: Writing to the mysql database in C language under the Linux system has been implemented. Now it is required to write the incremental ID number data column into the mysql database, as follows


Solution:

In the mysql table, design the table (the bedroom uses Navicat for mysql software to remotely connect to the server's mysql to modify the parameters of the table), and add the primary key field ID to the table, so that the field is automatically incremented and unsigned.  


Use the following statement in mysql to arbitrarily fill in a number in the ID field, and the table will automatically modify it to an ID number that starts monotonically increasing from 1:

INSERT INTO water values(1,2,3,4,5,6,7,8)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324780240&siteId=291194637