MySQL Personal FAQs

di Luigi Boschetti

Create a new GUID()

Use the mysql function UUID().

Example:

INSERT INTO Table1 ('ID', 'GUID') VALUES (0, UUID());

Reset AutoIncrement Counter

Set AUTO_INCREMENT for the Table to the desired value (must be bigger than the biggest current value in the table, for innodb tables).

Example:

ALTER TABLE Table1 AUTO_INCREMENT = 1