0

I want save randomly generated 20 character's alpha-numeric in mysql. What type of fields is better choice? varchar, binarym

user2969404
  • 27
  • 2
  • 10

1 Answers1

0

The best would be CHAR(20). But if you need to choose between varcher or binary, choose VARCHAR(20).

Here is a discussion how to generate a random string using SQL in case you want the generation to happen in MySQL: Generating a random & unique 8 character string using MySQL

Community
  • 1
  • 1
Plamen Nikolov
  • 2,643
  • 1
  • 13
  • 24