I have a binary(16) field in a table in MySQL, and I’d like to insert data at the MySQL command prompt into this field. I’ve tried:
- inserting numbers (4)
- inserting a 16-digit long binary string (10100000000000000)
Is there a way to insert this data at the command prompt? When I select binary data from the table in the command prompt, it looks like this: +??VA?:??. But inserting that same data back immediately doesn’t work.
Right, so BINARY data isn’t the same as a binary number. Whereas binary numbers is a representation of a number with just zeroes and ones BINARY data is more like raw data. As MySQL puts it
They reason it looks like +??VA?:?? is that your terminal cannot correctly represent the BINARY value.
Depending on the data you wish to enter have a look at the functions BINARY and CAST, they might work for you.