开发者

How to represent a GUID in MySQL? [duplicate]

开发者 https://www.devze.com 2023-02-25 06:08 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How should I store GUID in MySQL tables?
This question already has answers here: Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消