Skip to content

Instantly share code, notes, and snippets.

View c-gross's full-sized avatar

Christian c-gross

  • Germany
View GitHub Profile
@c-gross
c-gross / mysq_uuid_v4.md
Created October 17, 2023 14:31 — forked from odan/mysq_uuid_v4.md
Generating UUID v4 in MySQL

Generating UUID v4 in MySQL

SELECT
  LOWER(
    CONCAT(
      # 1th and 2nd block are made of 6 random bytes
      HEX(RANDOM_BYTES(4)),
      '-',
 HEX(RANDOM_BYTES(2)),