1

I just made a few changes to my tables changing varchar to varbinary after reading about it's advantages, and seeing that media wiki also use it.

So I created a table called test

CREATE TABLE `test` (
    `user` VARBINARY(255) NOT NULL
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM;

and inserted

insert into test (user) values ('Norman');

Result :0X4E6F726D616E

then

select user from test;

Result :0X4E6F726D616E

How do I get data from user in human readable form? How does this whole varbinary thing work?

I see MediWiki use it all over their database, but still get data out in a form that's readable. How is this done?

Norman
  • 6,159
  • 23
  • 88
  • 141
  • 1
    Out of curiosity: What are the advantages using `varbinary` for strings? – juergen d Aug 16 '14 at 09:15
  • @juergen d, I recommend to read http://stackoverflow.com/questions/5978484/what-is-the-advantage-of-using-varbinary-over-varchar-here – Branko Sego Aug 16 '14 at 09:29
  • It's a matter of opinion. I wouldn't have any advantage but but the disadvantage not being able to compare using a collation. Saving some bytes doesn't matter to me. – VMai Aug 16 '14 at 09:36

0 Answers0