It is advantageous to store a UUID (acc to RFC 4122) in a binary(16) field in the database.
It is not hard to create such a table and to insert data into it.
CREATE TABLE IF NOT EXISTS test_table ( id BINARY(16) NOT NULL, name VARCHAR(128) NOT NULL, PRIMARY KEY (id) ) INSERT INTO test_table (id, name) VALUES (UNHEX(REPLACE(UUID(),'-','')), 'test1'), (UNHEX(REPLACE(UUID(),'-','')), 'test2'), (UNHEX(REPLACE(UUID(),'-','')), 'test3') |
Pingback: PHP: converting a uuid stored as BINARY(16) in mysql to RFC 4122 format « Jontas