This question already has an answer here:
Can I do some thing like this in MySQL? I want to have a unique id generate by the database automatically but not using auto_increment.
CREATE TABLE cust(
CustomerID uniqueidentifier NOT NULL DEFAULT newid(),
Fax varchar(15) NULL
);
I have try this, but there has an error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'uniqueidentifier NOT NULL DEFAULT newid(), Fax varchar(15) NULL )' at line 2
</div>
You can use UUID() to create a Unique Value.
Eg.
INSERT INTO cust (CustomerID, Fax) Values(UUID(), "21312312");