I\'m generating UUIDs using PHP, per the function found here
Now I want to store that in a MySQL database. What is the best/most efficient MySQL field format for st
Question is about storing an UUID in MySQL.
Since version 8.0 of mySQL you can use binary(16)
with automatic conversion via UUID_TO_BIN/BIN_TO_UUID
functions:
https://mysqlserverteam.com/mysql-8-0-uuid-support/
Be aware that mySQL has also a fast way to generate UUIDs as primary key:
INSERT INTO t VALUES(UUID_TO_BIN(UUID(), true))