MySQL
keyboard_arrow_down 295 guides
chevron_leftString
check_circle
Mark as learned thumb_up
0
thumb_down
0
chat_bubble_outline
0
Comment auto_stories Bi-column layout
settings
MySQL | BINARY and VARBINARY
schedule Aug 12, 2023
Last updated local_offer
Tags MySQL
Master the mathematics behind data science with 100+ top-tier guides
Start your free 7-days trial now!
Start your free 7-days trial now!
The BINARY
and VARBINARY
types in MySQL are similar to CHAR
and VARCHAR
but they store binary strings rather than non-binary strings (i.e. byte strings rather than character strings).
NOTE
Byte strings have the binary character set and collation. Comparison and sorting is performed based on the numeric value of the bytes.
BINARY
BINARY(M)
M
represents column length in bytes. It is optional and defaults to 1
.
Values will be right-padded with the zero byte (0x00
) to the specified length. The right-padding is included in retrieval.
VARBINARY
VARBINARY(M)
M
represents column length in bytes.
Unlike for BINARY
, no padding is performed when VARBINARY
values are stored.
Published by Arthur Yanagisawa
Edited by 0 others
Did you find this page useful?
thumb_up
thumb_down
Comment
Citation
Ask a question or leave a feedback...
Official MySQL Documentation
https://dev.mysql.com/doc/refman/8.0/en/binary-varbinary.html
thumb_up
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!