How to represent a GUID in MySQL? [duplicate]
Possible Duplicate:
How should I store GUID in MySQL tables?
Hello,
To represent a GUID in MySQL, should I just use varchar? Also, since it is something that will be used to recognize a user, should it be encrypt开发者_如何学JAVAed? Or does that lost the point of having the GUID? :)
Thanks!
Yes, a varchar would be a good choice. Maybe even char, because the length is fixed, tough I don't know if you'd gain anything.
And I can't see why you would want to encrypt it.
a GUID is nothing else that a string, so varchar is enough yes. Encryption? No, I don't see the interest, in general we encrypts password in base, not the logins ;)
I guess you're coming from a SQL Server background. In MySQL you generally use an INTEGER(10) field with AUTO_INCREMENT as primary key. There's not really any reason to encrypt that value in any way.
精彩评论